From df3d7d5734855f72b72bdb18bbf9e3599dec0156 Mon Sep 17 00:00:00 2001 From: Nantha Sorubakanthan Date: Sun, 21 Sep 2025 17:32:32 +0200 Subject: first commit --- layouts/index.xml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 layouts/index.xml (limited to 'layouts/index.xml') diff --git a/layouts/index.xml b/layouts/index.xml new file mode 100644 index 0000000..3af797c --- /dev/null +++ b/layouts/index.xml @@ -0,0 +1,44 @@ +{{- $authorEmail := .Site.Params.email }} + +{{- $authorName := .Site.Params.name }} + +{{- $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 }} + + + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }} + {{ .Permalink }} + {{ .Site.Title }} + {{ $authorEmail }} ({{ $authorName }}) + Hugo + {{ site.Language.LanguageCode }}{{ with $authorEmail }} + {{.}}{{ with $authorName }} ({{ . }}){{ end }}{{ end }}{{ with $authorEmail }} + {{ . }}{{ with $authorName }} ({{ . }}){{ end }}{{ end }} + {{- with .OutputFormats.Get "RSS" }} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{- end }} + {{- range $pages }} + + {{ .Title }}{{ $title := .Title }} + {{ .Permalink }} + {{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{- with $authorEmail }}{{ . }}{{ with $authorName }} ({{ . }}){{ end }}{{ end }} + {{ .Permalink }} + {{- $emailprompt := "" }} + {{- with .Site.Params.links.email }}{{ $emailprompt = printf "← Reply-To" . $title }}{{ end }} + {{ ((printf "%s%s" .Content $emailprompt) | transform.XMLEscape) | safeHTML }} + + {{- end }} + + -- cgit v1.2.3