diff --git a/site/content/podcasts/_content.gotmpl b/site/content/podcasts/_content.gotmpl index 3cfa6bc..ea9918c 100644 --- a/site/content/podcasts/_content.gotmpl +++ b/site/content/podcasts/_content.gotmpl @@ -9,13 +9,13 @@ "duration" .duration_ms "preview" (index .images 0).url "audio_preview_url" .audio_preview_url + "id" .id }} {{ $dates := dict "date" (time.AsTime .release_date) }} {{ $page := dict "content" $content "title" .name "slug" (urlize .name) - "date" .release_date "type" "podcasts" "path" (urlize .name) "params" $params diff --git a/site/layouts/partials/duration-in-hours.html b/site/layouts/partials/duration-in-hours.html new file mode 100644 index 0000000..f13b042 --- /dev/null +++ b/site/layouts/partials/duration-in-hours.html @@ -0,0 +1,13 @@ +{{- $durationMs := . -}} +{{- $totalSeconds := div $durationMs 1000 -}} +{{- $hours := div $totalSeconds 3600 | int -}} +{{- $minutes := mod (div $totalSeconds 60) 60 -}} +{{- if gt $hours 0 -}} + {{- $hours }}hr +{{- end -}} +{{- if gt $minutes 0 -}} + {{- if gt $hours 0 -}} + {{- " " -}} + {{- end -}} + {{- $minutes }}m +{{- end -}} diff --git a/site/layouts/partials/most-favorite-podcast.html b/site/layouts/partials/most-favorite-podcast.html index 590e630..61a6d92 100644 --- a/site/layouts/partials/most-favorite-podcast.html +++ b/site/layouts/partials/most-favorite-podcast.html @@ -6,15 +6,13 @@