{{- define "main" -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if lt $limit 1 -}}
{{- $limit = .Paginator.TotalNumberOfElements -}}
{{- end -}}
{{- $lastBuildDate := now.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML -}}
{{- if not .Date.IsZero -}}
{{- $lastBuildDate = .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML -}}
{{- end -}}
{{- $title := partial "base-title.html" . -}}
{{- $description := partial "base-title.html" . -}}
{{- $author := partial "function-authors-data.html" . -}}
{{- if (eq .Page.Kind "section") -}}
{{- $title = $author.name -}}
{{- $description = $author.description | markdownify | html | htmlUnescape -}}
{{- end -}}
{{- if (eq .Page.Type "tags") -}}
{{- $title = print "#" (lower .Title) " -- " .Site.Title | markdownify | htmlUnescape -}}
{{- $description = print .Site.Title " Tags: #" .Title -}}
{{- end -}}
{{- $image := print "/" (partial "function-paths.html").media
"/" $author.user "/" $author.user "-profile" (path.Ext $author.picture.profile)
-}}
{{- if not (fileExists (print "public/" $image)) -}}
{{- $image = "/data/media/404.png" -}}
{{- end -}}
{{- $atomSelf := "" -}}
{{- $atomPrevious := "" -}}
{{- $atomNext := "" -}}
{{- with .OutputFormats.Get "RSS" -}}
{{- $atomSelf = printf `` .Permalink .MediaType | safeHTML -}}
{{- with $.Paginator.Prev -}}
{{- $atomPrevious = printf `` .URL | safeHTML -}}
{{- end -}}
{{- with $.Paginator.Next -}}
{{- $atomNext = printf `` .URL | safeHTML -}}
{{- end -}}
{{- end -}}
{{- $filteredPages := partial "function-filters-content.html" .Paginator.Pages -}}
{{- printf `` | safeHTML }}
{{ printf `` | safeHTML }}
{{ $title }}
{{ .Permalink }}
{{ $description }}
{{ .Site.LanguageCode }}
{{ $author.user }}
Hugo {{ hugo.Version }}
{{ $lastBuildDate }}
{{ $title }}
{{ .Site.BaseURL }}{{ $image }}
{{ .Permalink }}
{{ $atomSelf }}
{{ $atomPrevious }}
{{ $atomNext }}
{{ range first $limit $filteredPages -}}
{{- $author = partial "function-authors-data.html" . -}}
{{- $image = print "/" (partial "function-paths.html").media
"/" $author.user "/" $author.user "-profile" (path.Ext $author.picture.profile)
-}}
{{- if not (fileExists (print "public/" $image)) -}}
{{- $image = "/data/media/404.png" -}}
{{- end -}}
{{- $atomAuthorUri := print .Site.BaseURL $image -}}
{{- $atomAuthorName := or .Params.Feed.name $author.name -}}
{{- if .Params.Feed.favicon -}}
{{- $favicon := print "/" (partial "function-paths.html").media "/favicon." (.Params.Feed.source | anchorize) ".png" -}}
{{- if not (fileExists (print "public/" $favicon)) -}}
{{- $favicon = "/data/media/404.png" -}}
{{- end -}}
{{- $atomAuthorUri = print .Site.BaseURL $favicon -}}
{{- end -}}
-
{{ (or .Summary .Title) | htmlUnescape }}
{{ .Permalink }}
{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}
{{ .Permalink }}
{{- partial "function-content.html" . | html -}}
{{- print "
" | html -}}
{{- partial "rss-tags.html" . | html -}}
{{ $atomAuthorName }}
{{ $atomAuthorUri }}
{{ end -}}
{{- end -}}