2024-07-28 18:58:23 +08:00
|
|
|
{{- /* 定义页面上下文 */ -}}
|
2024-07-28 18:29:37 +08:00
|
|
|
{{- $page_context := cond .IsHome site . -}}
|
|
|
|
|
{{- $pages := $page_context.RegularPages -}}
|
2024-07-28 18:58:23 +08:00
|
|
|
{{- /* 过滤只包含类型为 'post' 的页面 */ -}}
|
|
|
|
|
{{- $pages = where $pages "Type" "post" -}}
|
2024-07-28 18:29:37 +08:00
|
|
|
{{- $limit := site.Config.Services.RSS.Limit -}}
|
|
|
|
|
{{- if ge $limit 1 -}}
|
2024-07-28 18:58:23 +08:00
|
|
|
{{- $pages = first $limit $pages -}}
|
2024-07-28 18:29:37 +08:00
|
|
|
{{- end -}}
|
2024-07-28 18:58:23 +08:00
|
|
|
|
|
|
|
|
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
2024-07-28 16:28:47 +08:00
|
|
|
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
|
|
|
|
<channel>
|
2024-07-28 18:29:37 +08:00
|
|
|
<title>{{ if ne .Title site.Title }}{{ with .Title }}{{.}} | {{ end }}{{end}}{{ site.Title }}</title>
|
2024-07-28 17:27:15 +08:00
|
|
|
<link>{{ .Permalink }}</link>
|
2024-07-28 18:29:37 +08:00
|
|
|
{{- with .OutputFormats.Get "RSS" }}
|
2024-07-28 16:57:25 +08:00
|
|
|
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
|
2024-07-28 18:29:37 +08:00
|
|
|
{{ end -}}
|
|
|
|
|
<description>{{ .Title | default site.Title }}</description>
|
|
|
|
|
<generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator>
|
|
|
|
|
{{- with site.LanguageCode }}<language>{{.}}</language>{{end -}}
|
|
|
|
|
{{- with site.Copyright }}<copyright>{{ replace (replace . "{year}" now.Year) "©" "©" | plainify }}</copyright>{{end -}}
|
|
|
|
|
{{- if not .Date.IsZero }}<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end -}}
|
|
|
|
|
{{- if .Scratch.Get "og_image" }}
|
|
|
|
|
<image>
|
|
|
|
|
<url>{{ .Scratch.Get "og_image" }}</url>
|
|
|
|
|
<title>{{ .Title | default site.Title }}</title>
|
|
|
|
|
<link>{{ .Permalink }}</link>
|
|
|
|
|
</image>
|
|
|
|
|
{{end -}}
|
|
|
|
|
{{ range $pages }}
|
|
|
|
|
<item>
|
|
|
|
|
<title>{{ .Title }}</title>
|
|
|
|
|
<link>{{ .Permalink }}</link>
|
|
|
|
|
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
|
|
|
|
<guid>{{ .Permalink }}</guid>
|
2024-07-28 18:58:23 +08:00
|
|
|
<description><![CDATA[
|
|
|
|
|
{{ .Content | safeHTML }}
|
|
|
|
|
]]></description>
|
2024-07-28 18:29:37 +08:00
|
|
|
</item>
|
2024-07-28 16:28:47 +08:00
|
|
|
{{ end }}
|
|
|
|
|
</channel>
|
2024-07-28 17:27:15 +08:00
|
|
|
</rss>
|