aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/_default/rss.xml
diff options
context:
space:
mode:
Diffstat (limited to 'themes/default/layouts/_default/rss.xml')
-rw-r--r--themes/default/layouts/_default/rss.xml42
1 files changed, 38 insertions, 4 deletions
diff --git a/themes/default/layouts/_default/rss.xml b/themes/default/layouts/_default/rss.xml
index d6a8f46..562da9e 100644
--- a/themes/default/layouts/_default/rss.xml
+++ b/themes/default/layouts/_default/rss.xml
@@ -10,9 +10,9 @@
{{- $lastBuildDate = .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML -}}
{{- end -}}
-{{- $author := partial "function-authors-data.html" . -}}
{{- $title := partial "base-title.html" . -}}
{{- $description := partial "base-title.html" . -}}
+{{- $author := partial "function-authors-data.html" . -}}
{{- if (eq .Page.Kind "section") -}}
{{- $title = $author.name -}}
@@ -55,7 +55,10 @@
{{- printf `<?xml version="1.0" encoding="utf-8" standalone="yes"?>` | safeHTML }}
{{ printf `<?xml-stylesheet href="/rss.xsl" type="text/xsl"?>` | safeHTML }}
-<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
+<rss
+ version="2.0"
+ xmlns:atom="http://www.w3.org/2005/Atom"
+>
<channel>
<title>{{ $title }}</title>
<link>{{ .Permalink }}</link>
@@ -67,13 +70,40 @@
<url>{{ $image.Permalink }}</url>
<link>{{ .Permalink }}</link>
</image>
+ <generator>Hugo {{ hugo.Version }}</generator>
<lastBuildDate>{{ $lastBuildDate }}</lastBuildDate>
{{ $atomSelf }}
{{ $atomPrevious }}
{{ $atomNext }}
- {{- range first $limit .Paginator.Pages }}
+ {{ range first $limit .Paginator.Pages }}
+
+ {{- $author = partial "function-authors-data.html" . -}}
+ {{- $profile = $author.picture.profile -}}
+ {{- $file = not (urls.Parse $profile).Host -}}
+
+ {{- if $file -}}
+ {{- $profile = print $author.user "/" $profile -}}
+ {{- end -}}
+
+ {{- $image = partial "function-caches-images.html"
+ (dict
+ "Source" $profile
+ "Fit" "160x160"
+ "Target" (print (partial "function-paths.html" "media") "/" $author.user "/")
+ "Copy" (print (partial "function-paths.html" "media") "/" $author.user "/" (path.Base $profile))
+ "AlternateCopy" (print (partial "function-paths.html" "media") "/" $author.user "/" (path.BaseName $profile) ".webp")
+ )
+ -}}
+
+ {{- $atomAuthorUri := $image.Permalink -}}
+ {{- $atomAuthorName := or .Params.Feed.name $author.name -}}
+
+ {{- if .Params.Feed.favicon -}}
+ {{- $atomAuthorUri = .Params.Feed.favicon | absURL -}}
+ {{- end -}}
+
{{ if and (not .Params.Unlisted) (not .ExpiryDate) }}
<item>
<title>{{ .Summary | htmlUnescape }}</title>
@@ -85,8 +115,12 @@
{{- print "<br>" | html -}}
{{- partial "rss-tags.html" . | html -}}
</description>
+ <atom:author>
+ <atom:name>{{ $atomAuthorName }}</atom:name>
+ <atom:uri>{{ $atomAuthorUri }}</atom:uri>
+ </atom:author>
</item>
- {{- end -}}
+ {{ end -}}
{{ end }}
</channel>
</rss>