Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ menu:
type: search

params:
# Site author info — read by the local RSS template override at
# layouts/_default/list.rss.xml. Hextra v0.8.3 ships a template that
# references the legacy .Site.Author, which Hugo 0.160+ no longer
# provides; the override reads from site.Params.author instead.
author:
name: ReproNim
email: info@repronim.org

navbar:
displayTitle: ReproNim
displayLogo: true
Expand Down
61 changes: 61 additions & 0 deletions layouts/_default/list.rss.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{{- /*
Local override of Hextra v0.8.3's layouts/_default/list.rss.xml.
The upstream template references the legacy .Site.Author hash, which
Hugo 0.160+ no longer exposes on the page.Site type, causing a hard
template error. This override reads the same values from
site.Params.author (set in hugo.yaml).
*/ -}}
{{- $author := site.Params.author -}}
Comment thread
asmacdo marked this conversation as resolved.
Outdated
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ site.Title }} – {{ .Title }}</title>
<link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ site.Title }}</description>
<generator>Hugo -- gohugo.io</generator>
{{- with site.LanguageCode }}
<language>{{ . }}</language>
{{- end }}
{{- with $author.email }}
<managingEditor>{{ . }}{{ with $author.name }} ({{ . }}){{ end }}</managingEditor>
<webMaster>{{ . }}{{ with $author.name }} ({{ . }}){{ end }}</webMaster>
{{- end }}
{{- with site.Copyright }}
<copyright>{{ . }}</copyright>
{{- end }}
{{- if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>
{{- end }}
{{ with .OutputFormats.Get "RSS" -}}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{- end }}
{{ if not $.Section }}
{{ $sections := site.Params.rss.sections | default (slice "blog") }}
Comment thread
asmacdo marked this conversation as resolved.
Outdated
{{ .Scratch.Set "rssPages" (first 50 (where site.RegularPages "Type" "in" $sections)) }}
{{ else }}
{{ if $.Parent.IsHome }}
{{ .Scratch.Set "rssPages" (first 50 (where site.RegularPages "Type" $.Section)) }}
{{ else }}
{{ .Scratch.Set "rssPages" (first 50 $.Pages) }}
{{ end }}
{{ end }}
{{ range (.Scratch.Get "rssPages") }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{- with $author.email }}
<author>{{ . }}{{ with $author.name }} ({{ . }}){{ end }}</author>
{{- end }}
<guid>{{ .Permalink }}</guid>
<description>
{{ $img := (.Resources.ByType "image").GetMatch "*featured*" }}
{{ with $img }}
{{ $img := .Resize "640x" }}
{{ printf "<![CDATA[<img src=\"%s\" width=\"%d\" height=\"%d\"/>]]>" $img.Permalink $img.Width $img.Height | safeHTML }}
{{ end }}
{{ .Content | html }}
</description>
</item>
{{ end }}
</channel>
</rss>
Loading