From ae896059369bbd9aa492bd9a14b36700df334f3a Mon Sep 17 00:00:00 2001 From: JP Hastings-Spital Date: Fri, 31 Jan 2025 19:06:07 +0000 Subject: [PATCH] Adds podcast page & XML --- config.toml | 18 +++++++++++----- layouts/_default/list.podcast.xml | 36 +++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 layouts/_default/list.podcast.xml diff --git a/config.toml b/config.toml index 9868f3c5..c3a6e316 100644 --- a/config.toml +++ b/config.toml @@ -218,6 +218,10 @@ date = ["date", "publishDate", "lastmod", ":git"] [outputFormats.rss] baseName = 'index' name = 'rss' + [outputFormats.podcast] + baseName = 'podcast' + mediaType = 'application/rss+xml' + isHTML = false [outputFormats.gemini] name = 'Gemini' isPlainText = true @@ -244,14 +248,18 @@ date = ["date", "publishDate", "lastmod", ":git"] notAlternative = true [outputs] - home = ["html", "rss", "gemini", "redirects"] + home = ["html", "rss", "podcast", "gemini", "redirects"] page = ["html", "gemini"] - rss = ["rss"] - section = ["html", "rss", "gemini"] - taxonomy = ["html", "rss", "gemini"] - term = ["html", "rss", "gemini"] + rss = ["rss", "podcast"] + section = ["html", "rss", "podcast", "gemini"] + taxonomy = ["html", "rss", "podcast", "gemini"] + term = ["html", "rss", "podcast", "gemini"] [minify] [minify.tdewolff] [minify.tdewolff.html] keepQuotes = true + +[services] + [services.rss] + limit = 42 diff --git a/layouts/_default/list.podcast.xml b/layouts/_default/list.podcast.xml new file mode 100644 index 00000000..e4d97360 --- /dev/null +++ b/layouts/_default/list.podcast.xml @@ -0,0 +1,36 @@ +{{- $pages := slice -}} +{{- if .IsHome -}} + {{- $pages = where .Site.RegularPages "Type" "not in" (slice "memex" "timeless" "site-infra" "reading-lists" "notes" "likes") -}} +{{- else -}} + {{- $pages = .Pages -}} +{{- end -}} +{{- printf "" | safeHTML }} +{{- printf "" | safeHTML }} + + + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} + {{ .Permalink | absURL }} + Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }} + Hugo -- gohugo.io{{ with .Site.LanguageCode }} + {{.}}{{end}}{{ with .Site.Params.Author.email }} + {{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Params.Author.email }} + {{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} + {{.}}{{end}}{{ if not .Date.IsZero }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} + {{- range $i, $page := $pages -}} + {{- if not .Page.Params.Audio -}}{{ continue }}{{- end -}} + {{ with .Title }} + {{ . }}{{ else }}{{ end }} + {{ .Permalink | absURL }} + {{ if .Page.Params.Audio }}{{end}} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ .Permalink | absURL }} + {{- partial "description.txt" . -}} + {{- partial "feedpost.html" . | html -}} + {{- range .Params.syndications}} + {{ . }} + {{- end }} + + {{ end }} + +