From 5664417e66fa85661500bcffc1757116525c6ddf Mon Sep 17 00:00:00 2001 From: Dominic Reich Date: Sat, 17 Jun 2023 22:29:20 +0200 Subject: [PATCH] fix output formats (HTML,Atom,RSS,JSON,etc.) --- config/_default/config.toml | 4 +++ layouts/equipment/section.atom.xml | 39 ++++++++++++++++++++++++++++++ layouts/posts/section.atom.xml | 39 ++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 layouts/equipment/section.atom.xml create mode 100644 layouts/posts/section.atom.xml diff --git a/config/_default/config.toml b/config/_default/config.toml index c953484..b4ddb97 100644 --- a/config/_default/config.toml +++ b/config/_default/config.toml @@ -37,4 +37,8 @@ summaryLength = 0 [outputs] home = [ "HTML", "Atom", "JSON", "HumansTXT" ] + page = ["HTML"] + section = ["HTML", "Atom"] + taxonomyTerm = ["HTML"] + taxonomy = ["HTML"] diff --git a/layouts/equipment/section.atom.xml b/layouts/equipment/section.atom.xml new file mode 100644 index 0000000..3191e04 --- /dev/null +++ b/layouts/equipment/section.atom.xml @@ -0,0 +1,39 @@ +{{- $pctx := . -}} +{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} +{{- $pages := $pctx.RegularPages -}} +{{- $limit := .Site.Config.Services.RSS.Limit -}} +{{- if ge $limit 1 -}} +{{- $pages = $pages | first $limit -}} +{{- end -}} +{{- printf "" | safeHTML }} + + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} + + {{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }} + + Dominic Reich “OE7DRT” + dominic@noreply.oe7drt.com + https://oe7drt.com + + {{ .Permalink }} + {{ range $pages }}{{ if ne .Params.feed_exclude true }} + + {{ .Title }} + + Dominic Reich “OE7DRT” + dominic@noreply.oe7drt.com + https://oe7drt.com + + + {{ .Permalink }} + {{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }} + {{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }} + {{ if .Site.Params.rssFullContent }} + {{ .Summary | html }} + {{ .Content | html }} + {{ else }} + {{ .Summary | html }} + {{ end }} + + {{ end }}{{ end }} + diff --git a/layouts/posts/section.atom.xml b/layouts/posts/section.atom.xml new file mode 100644 index 0000000..3191e04 --- /dev/null +++ b/layouts/posts/section.atom.xml @@ -0,0 +1,39 @@ +{{- $pctx := . -}} +{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} +{{- $pages := $pctx.RegularPages -}} +{{- $limit := .Site.Config.Services.RSS.Limit -}} +{{- if ge $limit 1 -}} +{{- $pages = $pages | first $limit -}} +{{- end -}} +{{- printf "" | safeHTML }} + + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} + + {{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }} + + Dominic Reich “OE7DRT” + dominic@noreply.oe7drt.com + https://oe7drt.com + + {{ .Permalink }} + {{ range $pages }}{{ if ne .Params.feed_exclude true }} + + {{ .Title }} + + Dominic Reich “OE7DRT” + dominic@noreply.oe7drt.com + https://oe7drt.com + + + {{ .Permalink }} + {{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }} + {{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }} + {{ if .Site.Params.rssFullContent }} + {{ .Summary | html }} + {{ .Content | html }} + {{ else }} + {{ .Summary | html }} + {{ end }} + + {{ end }}{{ end }} +