From 577f499815fe125e7f1d5c7bb905341047ff93212312bc00f14c4326dfa91621 Mon Sep 17 00:00:00 2001 From: Nicholas Johnson Date: Sat, 30 Apr 2022 00:00:00 +0000 Subject: Remove variable declaractions and conditions from Atom feed templates --- layouts/index.atom.xml | 14 +------------- 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 -}} {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }} @@ -21,7 +9,7 @@ {{ $.Site.Author.name }} {{ $.Site.Author.email }} - Hugo -- gohugo.io{{ range $pages }} + Hugo -- gohugo.io{{ range first .Site.Config.Services.RSS.Limit .Site.RegularPages }} {{ `<![CDATA[` | safeHTML }}{{ .Title }}]]> 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 -}} {{ replace .Permalink "https://" "gemini://" }} @@ -23,7 +11,7 @@ Hugo -- gohugo.io {{ $.Site.Copyright }} {{ .Site.Params.beginCopyrightYear }}-{{ now.Format "2006" }} {{ $.Site.Author.name }} - {{ $.Site.Params.Description }}{{ range $pages }} + {{ $.Site.Params.Description }}{{ range first .Site.Config.Services.RSS.Limit .Site.RegularPages }} {{ replace .Permalink "https://" "gemini://" | safeURL }} {{ .Title }} -- cgit v1.2.3