diff options
| author | Eltrac <hi@guhub.cn> | 2025-04-29 16:58:24 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-04-29 16:58:24 +0800 |
| commit | 4a4f9663878ec1fe7e7af507f791fe8f06d8349a (patch) | |
| tree | 09dcf3f3a4199019423ea05280377c46263dba61 | |
| parent | 8e7bf0f70127eff912e3822b7a4956e5bdc9522a (diff) | |
chore: output all content in rss instead of summary
Former-commit-id: b11edb432963d9a13e523e88d97a7f60150542a7
| -rw-r--r-- | layouts/rss.xml | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/layouts/rss.xml b/layouts/rss.xml new file mode 100644 index 00000000..3182c3c1 --- /dev/null +++ b/layouts/rss.xml @@ -0,0 +1,26 @@ +<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> + <channel> + <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} | {{ end }}{{ .Site.Title }}{{ end }}</title> + <link>{{ .Permalink }}</link> + <description>{{ .Site.Title }}:{{ if ne .Title .Site.Title }}{{ with .Title }}在「{{.}}」分区下的最新内容{{ end }}{{ end }}</description> + <generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }} + <language>{{.}}</language>{{end}}{{ with .Site.Author.email }} + <managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }} + <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }} + <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 />" .Permalink .MediaType | safeHTML }} + {{ end }} + {{ range first 10 .Data.Pages }} + <item> + <title>{{ .Title }}</title> + <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>{{ .Permalink }}</guid> + <description>{{ .Content | html }}</description> + </item> + {{ end }} + </channel> +</rss> |
