Skip to content

Commit

Permalink
add category element to rss feeds. it lists tags by default
Browse files Browse the repository at this point in the history
  • Loading branch information
M1cR0xf7 committed Sep 5, 2023
1 parent 1b64b74 commit 33efc17
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions layouts/_default/rss.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
{{- 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>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
Expand All @@ -29,6 +30,11 @@
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
{{- with .Params.Tags -}}
{{- range $tag := . }}
<category>{{ $tag }}</category>
{{- end -}}
{{- end -}}
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
Expand Down

0 comments on commit 33efc17

Please sign in to comment.