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 @@

Most Favorite Podca Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi pharetra magna a lacus dignissim, sed scelerisque elit rutrum. Nam a pulvinar sapien, a placerat arcu. Nam condimentum orci et semper rutrum.

-
- {{ partial "podcastA.html" . }} -
-
- {{ partial "podcastA.html" . }} -
-
- {{ partial "podcastA.html" . }} -
+ {{ $targetIds := slice "3LEaVHBStIllvP1hLkfkl3" "5gOaOrHXLCpnUvinv1RJGX" "4Ecjpkzht6Hl1s96OjKzFT" }} + {{ $podcastPages := where .Site.Pages "Type" "podcasts" }} + {{ range $podcastPages }} + {{ if in $targetIds .Params.id }} + {{ partial "podcastA.html" . }} + {{ end }} + {{ end }}
diff --git a/site/layouts/partials/podcastA.html b/site/layouts/partials/podcastA.html index d716467..6f82fef 100644 --- a/site/layouts/partials/podcastA.html +++ b/site/layouts/partials/podcastA.html @@ -8,19 +8,23 @@ - image + {{ if .Params.preview }} + image + {{ else }} + image + {{ end }}
- 1hr 24m + {{- partial "duration-in-hours.html" .Params.duration }}
- 13 October 2023 + {{ .Date | time.Format "2 January 2006" }}
-

Bryan Knoxville: How to Live a Life Full of Music | E106
+
{{ .Title }}