diff options
author | Nicholas Johnson <nick@nicksphere.ch> | 2022-04-30 00:00:00 +0000 |
---|---|---|
committer | Nicholas Johnson <nick@nicksphere.ch> | 2022-04-30 00:00:00 +0000 |
commit | 577f499815fe125e7f1d5c7bb905341047ff93212312bc00f14c4326dfa91621 (patch) | |
tree | d4b9c227130be5da9a1d012fe3235a9efbb22d1ffe6f50fecd668256e0b16497 | |
parent | b0e1b8a5ef77332e77ef0c2f22caa0ee53baec9025182eeb3c81ace68843089f (diff) | |
download | hugo-theme-journal-577f499815fe125e7f1d5c7bb905341047ff93212312bc00f14c4326dfa91621.tar.gz hugo-theme-journal-577f499815fe125e7f1d5c7bb905341047ff93212312bc00f14c4326dfa91621.zip |
Remove variable declaractions and conditions from Atom feed templates
-rw-r--r-- | layouts/index.atom.xml | 14 | ||||
-rw-r--r-- | layouts/index.gemini_atom.xml | 14 |
2 files changed, 2 insertions, 26 deletions
diff --git a/layouts/index.atom.xml b/layouts/index.atom.xml index 6f239aa..ecca11a 100644 --- a/layouts/index.atom.xml +++ b/layouts/index.atom.xml @@ -1,15 +1,3 @@ -{{ $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 -}} <?xml version="1.0" encoding="UTF-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }}</title> @@ -21,7 +9,7 @@ <name>{{ $.Site.Author.name }}</name> <email>{{ $.Site.Author.email }}</email> </author> - <generator>Hugo -- gohugo.io</generator>{{ range $pages }} + <generator>Hugo -- gohugo.io</generator>{{ range first .Site.Config.Services.RSS.Limit .Site.RegularPages }} <entry> {{ `<title type="html"><![CDATA[` | safeHTML }}{{ .Title }}]]></title> <link href="{{ .Permalink }}"/> diff --git a/layouts/index.gemini_atom.xml b/layouts/index.gemini_atom.xml index 9eca6e6..4e43a5e 100644 --- a/layouts/index.gemini_atom.xml +++ b/layouts/index.gemini_atom.xml @@ -1,15 +1,3 @@ -{{ $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 -}} <?xml version="1.0" encoding="UTF-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> <id>{{ replace .Permalink "https://" "gemini://" }}</id> @@ -23,7 +11,7 @@ </author> <generator>Hugo -- gohugo.io</generator> <rights type="html">{{ $.Site.Copyright }} {{ .Site.Params.beginCopyrightYear }}-{{ now.Format "2006" }} {{ $.Site.Author.name }}</rights> - <subtitle>{{ $.Site.Params.Description }}</subtitle>{{ range $pages }} + <subtitle>{{ $.Site.Params.Description }}</subtitle>{{ range first .Site.Config.Services.RSS.Limit .Site.RegularPages }} <entry> <id>{{ replace .Permalink "https://" "gemini://" | safeURL }}</id> <title>{{ .Title }}</title> |