add categories to feed

Amolith created

Change summary

themes/secluded/layouts/_default/rss.xml | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

Detailed changes

themes/secluded/layouts/_default/rss.xml 🔗

@@ -28,8 +28,15 @@
     <item>
       <title>{{ .Title }}</title>
       <link>{{ .Permalink }}</link>
+      {{- if .Params.Tags }}
+      <category>{{ range $key, $value := .Params.Tags }}{{ if $key }}/{{ end }}{{ $value }}{{ end }}</category>>
+      {{- else }}
+      {{- if .Params.Rss_only }}
+      <category>RSS-only</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}}
+      {{- with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
       <guid>{{ .Permalink }}</guid>
       <description>{{ .Content | html }}</description>
     </item>