From 89cf19ecd10f743dd186a176462cdc54ac31e229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian-Samuel=20Geb=C3=BChr?= Date: Wed, 21 Jun 2023 17:11:25 +0200 Subject: [PATCH] Lay foundation for RSS rework --- config.toml | 7 ++++-- layouts/rss.xml | 44 +++++++++++++++++++++++++++++++++++++ themes/hugo-nederburg-theme | 2 +- 3 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 layouts/rss.xml diff --git a/config.toml b/config.toml index e61a673..e2d5f8d 100644 --- a/config.toml +++ b/config.toml @@ -80,8 +80,6 @@ paginate = 5 #frontpage pagination instagram = "https://www.instagram.com/julian_samuel_gebuehr/" facebook = "https://www.facebook.com/juliansamuel.gebuhr" mastodon = "https://chaos.social/@moanos" - #pinterest = "full profile url in pinterest" - #googleplus = "full profile url in googleplus" rss = true [[params.fediverse]] url = "https://chaos.social/@moanos" @@ -92,3 +90,8 @@ paginate = 5 #frontpage pagination [[params.fediverse]] url = "https://pixelfed.social/@moanos" name= "Pixelfed" + + +[outputs] + home = ["HTML", "RSS"] + diff --git a/layouts/rss.xml b/layouts/rss.xml new file mode 100644 index 0000000..22e5ff1 --- /dev/null +++ b/layouts/rss.xml @@ -0,0 +1,44 @@ +{{- $pctx := . -}} +{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} +{{- $pages := slice -}} +{{- if or $.IsHome $.IsSection -}} +{{- $pages = $pctx.RegularPages -}} +{{- else -}} +{{- $pages = $pctx.Pages -}} +{{- end -}} +{{- $limit := .Site.Config.Services.RSS.Limit -}} +{{- if ge $limit 1 -}} +{{- $pages = $pages | first $limit -}} +{{- end -}} +{{- printf "" | safeHTML }} +{{- printf "" | safeHTML }} + + + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} + {{ .Permalink }} + Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }} + Hugo -- gohugo.io + {{ site.LanguageCode }}{{ with .Site.Author.email }} + {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} + {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} + {{ with .Site.Copyright }} + {{.}} + {{end}} + {{ if not .Date.IsZero }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ end }} + {{- with .OutputFormats.Get "RSS" -}} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{- end -}} + {{ range $pages }} + + {{ .Title }} + {{ .Permalink }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} + {{ .Permalink }} + {{ .Content | html }} + + {{ end }} + \ No newline at end of file diff --git a/themes/hugo-nederburg-theme b/themes/hugo-nederburg-theme index 79d7abb..c2f903d 160000 --- a/themes/hugo-nederburg-theme +++ b/themes/hugo-nederburg-theme @@ -1 +1 @@ -Subproject commit 79d7abbab69ce48fbfeb5bb74222a509fb9e0de5 +Subproject commit c2f903d0b270e90dba32e6ae51690e55cb523f56