Skip to content

Commit

Permalink
Adds support for author uris in Atom feed
Browse files Browse the repository at this point in the history
  • Loading branch information
amandafrench committed Feb 4, 2025
1 parent 171197b commit eb0e056
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions themes/hugo-ror/layouts/_default/index.atom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,16 @@
<id>{{ .Permalink }}</id>
<published>{{ .Date.Format .Site.Params.dateFormatAtomFeed | safeHTML }}</published>
<updated>{{ .Lastmod.Format .Site.Params.dateFormatAtomFeed | safeHTML }}</updated>

{{ if isset .Params "authors" }}
{{ range $author := .Params.authors }}
<author>
<name>{{ $author }}</name>
</author>
{{ end }}
{{ else if .Params.author }}
<author>
<name>{{ .Params.author }}</name>
</author>
{{ else }}
<author>
<name>{{ .Site.Params.Author.name }}</name>
</author>
{{ end }}

<content type="html" xml:base="{{ .Site.BaseURL }}" {{ with .Site.LanguageCode }}xml:lang="{{.}}"{{end}}>
{{- range .GetTerms "authors" }}
<author>
<name>{{ .Page.Title }}</name>
{{ with .Page.Params.orcid }}<uri>{{ . }}</uri>{{ end }}
</author>
{{- end }}
<content type="xhtml" xml:base="{{ .Site.BaseURL }}" {{ with .Site.LanguageCode }}xml:lang="{{.}}"{{end}}>
{{ printf "<![CDATA[%s]]>" .Content | safeHTML }}
</content>
<summary type="html" xml:base="{{ .Site.BaseURL }}" {{ with .Site.LanguageCode }}xml:lang="{{.}}"{{end}}>
<summary type="xhtml" xml:base="{{ .Site.BaseURL }}" {{ with .Site.LanguageCode }}xml:lang="{{.}}"{{end}}>
{{ if .Description }} {{ .Description | plainify }} {{ else }} {{ .Summary | plainify }} {{ end }}
</summary>
</entry>
Expand Down

0 comments on commit eb0e056

Please sign in to comment.