Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/cntrump/hugo-notepadium.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliuwentao <liuwentao@gmail.com>2020-11-06 11:56:16 +0300
committerliuwentao <liuwentao@gmail.com>2020-11-06 11:56:16 +0300
commit9f64cb6cd460cd4b889934af4e04e4130c12e01f (patch)
tree490102cfa3e99698684299557d87d7e3b5fcfa05
parent693cfb739de100234d6b38910589ca004ffafeea (diff)
修复rss输出
-rw-r--r--layouts/_default/rss.xml20
1 files changed, 8 insertions, 12 deletions
diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml
index f0d19d9..3163560 100644
--- a/layouts/_default/rss.xml
+++ b/layouts/_default/rss.xml
@@ -1,8 +1,7 @@
-{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
-<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
+<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>{{ .RelPermalink }}</link>
+ <link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
@@ -11,20 +10,17 @@
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{ with .OutputFormats.Get "RSS" }}
- {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .RelPermalink .MediaType | safeHTML }}
+ {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{ end }}
- {{ range .Pages }}
+ {{ range first 10 .Site.RegularPages }}
<item>
<title>{{ .Title }}</title>
- <link>{{ .RelPermalink }}</link>
+ <link>{{ .Permalink }}</link>
<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>{{ .RelPermalink }}</guid>
- <description>{{ .Summary | html }}</description>
- {{ if and (isset .Site.Params "fullrss") (.Site.Params.fullrss) }}
- <content:encoded>{{ `<![CDATA[` | safeHTML }}{{ .Content | safeHTML }}{{ `]]>` | safeHTML }}</content:encoded>
- {{ end }}
+ <guid>{{ .Permalink }}</guid>
+ <description>{{ .Content | html }}</description>
</item>
{{ end }}
</channel>
-</rss>
+</rss> \ No newline at end of file