{{- $pctx := . -}} {{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} {{- $pages := slice -}} {{- if $.IsHome -}} {{- $mainSections := site.Params.mainSections | default (slice "posts") }} {{- $pages = where $pctx.RegularPages.ByDate.Reverse "Type" "in" $mainSections -}} {{- else if $.IsSection -}} {{- $pages = $pctx.RegularPages.ByDate.Reverse -}} {{- else -}} {{- $pages = $pctx.Pages -}} {{- end -}} {{- $limit := site.Params.feedSize | default 25 -}} {{- $pages = $pages | first $limit -}} {{- $siteLastMod := partial "site-last-mod.html" . -}} {{- safeHTML "" }} {{ printf `<![CDATA[%s]]>` (partial "title.html" .) | safeHTML }} {{ with site.Params.description }}{{ printf `` . | safeHTML }}{{ end }} {{- $output_formats := .OutputFormats }} {{- range $output_formats -}} {{- $rel := (or (and (eq "atom" (.Name | lower)) "self") "alternate") -}} {{- with $output_formats.Get .Name }} {{ printf `` .RelPermalink $rel .MediaType.Type .Name | safeHTML }} {{- end -}} {{- end }} {{ $logo := resources.Get (site.Params.assets.logo | default "/img/open-graph-logo.png") }}{{ $logo = $logo.Resize "96x96" }}{{ $logo.Permalink | absURL }} {{ $logo.Permalink | absURL }}{{ with site.Author.name }} {{ printf `` . | safeHTML }} {{ with site.Author.email }}{{ . | html }}{{ end }} {{ end }}{{ with site.Params.Copyright }}{{ $copyright := replace . "{year}" now.Year }}{{ $copyright = replace $copyright "©" "©" }} {{ $copyright | plainify }}{{ end }} Hugo{{ if ne $siteLastMod "" }} {{ $siteLastMod.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}{{ end }}{{ $uuid := sha1 (site.BaseURL | absURL) }} urn:uuid:{{ substr $uuid 0 8 }}-{{ substr $uuid 8 4 }}-5{{ substr $uuid 13 3 }}-{{ substr $uuid 16 1 }}9{{ substr $uuid 17 2 }}-{{ substr $uuid 21 12 }}{{- range $pages }} {{- $url := .Permalink | absURL }}{{ $uuid := sha1 (.Permalink | absURL) }}{{ $page := . }} {{ $section := .Section }} {{ range (.GetTerms "tags") }} {{ if not (eq .LinkTitle $section) }} {{ end }} {{ end }} {{ printf `<![CDATA[%s]]>` .Title | safeHTML }} {{/* See: https://discourse.gohugo.io/t/using-regularpages-related-gives-me-keywords-index-support-error/35657?u=egrep */}} {{ $related := first 5 (where (where .Site.Pages ".Params.tags" "intersect" .Params.tags) "Permalink" "!=" .Permalink) }} {{ range $related }} {{ end }} {{ .Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}{{ if ne .Date .Lastmod }} {{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}{{ end }} urn:uuid:{{ substr $uuid 0 8 }}-{{ substr $uuid 8 4 }}-5{{ substr $uuid 13 3 }}-{{ substr $uuid 16 1 }}9{{ substr $uuid 17 2 }}-{{ substr $uuid 21 12 }} {{ if .Params.author }} {{- $author_type := (printf "%T" .Params.author) }} {{- if eq $author_type "string" }} {{ .Params.author }} {{- else if eq $author_type "[]string" }} {{ range .Params.author }} {{ .Name }} {{ end }} {{- end }} {{ end }} {{ printf `` .Summary | safeHTML }} {{ end }}