Skip to content

Commit

Permalink
tags in rss displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
vindex10 committed Jan 2, 2024
1 parent 045c084 commit 44caf6f
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions layouts/_default/rss.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
{{- if ge $limit 1 }}
{{- $pages = $pages | first $limit }}
{{- end }}
{{- $defaultTaxonomies := slice }}
{{- range $taxonomy, $v := site.Taxonomies}}
{{- $defaultTaxonomies = $defaultTaxonomies | append $taxonomy }}
{{- end}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
Expand All @@ -64,18 +68,24 @@
{{- with .OutputFormats.Get "RSS" }}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{- end }}
{{- range $pages }}
{{- if and (ne .Layout `search`) (ne .Layout `archives`) }}
{{ range $page := $pages }}
{{- if and (ne $page.Layout `search`) (ne $page.Layout `archives`) }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
<title>{{ $page.Title }}</title>
<link>{{ $page.Permalink }}</link>
<pubDate>{{ $page.Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{- with $authorEmail }}<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>{{ end }}
<guid>{{ .Permalink }}</guid>
<description>{{ with .Description | html }}{{ . }}{{ else }}{{ .Summary | html }}{{ end -}}</description>
{{- if site.Params.ShowFullTextinRSS }}
<content:encoded>{{ (printf "<![CDATA[%s]]>" .Content) | safeHTML }}</content:encoded>
<guid>{{ $page.Permalink }}</guid>
<description>{{ with $page.Description | html }}{{ . }}{{ else }}{{ $page.Summary | html }}{{ end -}}</description>
{{- $taxonomies := (site.Params.TaxonomiesInRSS | default $defaultTaxonomies ) }}
{{- range $taxonomy := $taxonomies }}
{{- range $tag := ($page.GetTerms $taxonomy) }}
<category domain="{{ $taxonomy }}">{{ $tag.LinkTitle }}</category>
{{- end }}
{{- end }}
{{- if site.Params.ShowFullTextinRSS }}
<content:encoded>{{ (printf "<![CDATA[%s]]>" $page.Content) | safeHTML }}</content:encoded>
{{- end }}
</item>
{{- end }}
{{- end }}
Expand Down

0 comments on commit 44caf6f

Please sign in to comment.