{{ printf `` | safeHTML }} {{/* ref: https://validator.w3.org/feed/docs/atom.html */}} Hugo {{- $title := site.Title -}} {{- with .Title -}} {{- if (not (eq . site.Title)) -}} {{- $title = printf `%s %s %s` . (i18n "feed_title_on" | default "on") site.Title -}} {{- end -}} {{- end -}} {{- if .IsTranslated -}} {{ $title = printf "%s (%s)" $title (index site.Data.i18n.languages .Lang) }} {{- end -}} {{ printf `<![CDATA[%s]]>` $title | safeHTML }} {{ with (or (.Param "subtitle") (.Param "tagline")) }} {{ printf `` . | safeHTML }} {{ end }} {{ $output_formats := .OutputFormats }} {{ range $output_formats -}} {{- $rel := (or (and (eq "atom" (.Name | lower)) "self") "alternate") -}} {{ with $output_formats.Get .Name }} {{ printf `` .Permalink $rel .MediaType.Type .Name | safeHTML }} {{- end -}} {{- end }} {{- range .Translations }} {{ $output_formats := .OutputFormats }} {{- $lang := .Lang }} {{- $langstr := index site.Data.i18n.languages .Lang }} {{ range $output_formats -}} {{ with $output_formats.Get .Name }} {{ printf `` .Permalink .MediaType.Type $lang $langstr .Name | safeHTML }} {{- end -}} {{- end }} {{- end }} {{ now.Format "2006-01-02T15:04:05-07:00" | safeHTML }} {{ with site.Copyright }} {{- $copyright := replace . "{year}" now.Year -}} {{/* In case the site.copyright uses a special string "{year}" */}} {{- $copyright = replace $copyright "©" "©" -}} {{ $copyright | plainify }} {{- end }} {{ with .Param "feed" }} {{/* For this to work, the $icon file should be present in the assets/ directory */}} {{- $icon := .icon | default "icon.svg" -}} {{- with resources.Get $icon -}} {{ (. | fingerprint).Permalink }} {{- end }} {{/* For this to work, the $logo file should be present in the assets/ directory */}} {{- $logo := .logo | default "logo.svg" -}} {{- with resources.Get $logo -}} {{ (. | fingerprint).Permalink }} {{- end }} {{ end }} {{ with site.Author.name -}} {{ . }} {{ with site.Author.email }} {{ . }} {{ end -}} {{- end }} {{ with site.Params.id }} {{ . | plainify }} {{ else }} {{ .Permalink }} {{ end }} {{- $limit := (cond (le site.Config.Services.RSS.Limit 0) 65536 site.Config.Services.RSS.Limit) }} {{- $feed_sections := site.Params.feedSections | default site.Params.mainSections -}} {{/* Range through only the pages with a Type in $feed_sections. */}} {{- $pages := where .RegularPages "Type" "in" $feed_sections -}} {{- if (eq .Kind "home") -}} {{- $pages = where site.RegularPages "Type" "in" $feed_sections -}} {{- end -}} {{/* Remove the pages that have the disable_feed parameter set to true. */}} {{- $pages = where $pages ".Params.disable_feed" "!=" true -}} {{/* Remove the pages that have the unlisted parameter set to true. */}} {{- $pages = where $pages ".Params.unlisted" "!=" true -}} {{- range first $limit $pages }} {{ $page := . }} {{ printf `<![CDATA[%s]]>` .Title | safeHTML }} {{- range .Translations }} {{- $link := printf "%s?utm_source=atom_feed" .Permalink | safeHTML }} {{- printf `` $link .Lang | safeHTML }} {{- end }} {{/* rel=related: See https://validator.w3.org/feed/docs/atom.html#link */}} {{- range first 5 (site.RegularPages.Related .) }} {{- end }} {{ with .Params.id }} {{ . | plainify }} {{ else }} {{ .Permalink }} {{ end }} {{ with .Params.author -}} {{ . }} {{- end }} {{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }} {{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }} {{ $description1 := .Description | default "" }} {{ $description := (cond (eq "" $description1) "" (printf "
%s
" ($description1 | markdownify))) }} {{ printf `` $description .Content | safeHTML }} {{ with site.Taxonomies }} {{ range $taxo,$_ := . }} {{ with $page.Param $taxo }} {{ $taxo_list := . }} {{ with site.GetPage (printf "/%s" $taxo) }} {{ $taxonomy_page := . }} {{ range $taxo_list }} {{ end }} {{ end }} {{ end }} {{ end }} {{ end }}
{{ end }}