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