Skip to content

Commit

Permalink
both support description tag and content tag for rss
Browse files Browse the repository at this point in the history
  • Loading branch information
yurenju committed Jul 15, 2023
1 parent a26ff1c commit 7936dda
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions themes/hugo-blog-awesome/layouts/_default/rss.xml
Expand Up @@ -11,7 +11,7 @@
{{- $pages = $pages | first $limit -}}
{{- end -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
Expand All @@ -32,7 +32,12 @@
<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>
<description>{{ .Content | html }}</description>
<description>{{ .Summary | html }}</description>
<content:encoded>
{{ `<![CDATA[` | safeHTML }}
{{ .Content }}
{{ `]]>` | safeHTML }}
</content:encoded>
</item>
{{ end }}
</channel>
Expand Down

0 comments on commit 7936dda

Please sign in to comment.