修改rss订阅 最终版
This commit is contained in:
1 parent
05fb06ef42
commit
4b65c94ee8
219 files changed
+36801
-18604
No files matched your search
+21
-26
@@ -15,32 +15,6 @@ authorImage = "https://avatars.githubusercontent.com/u/94612053"
|
||||
# 自定义描述
|
||||
description = "风吹云散,云卷云舒"
|
||||
|
||||
# 分页展示文章数 每页展示文章的数量
|
||||
paginate = 5
|
||||
|
||||
hasCJKLanguage = true
|
||||
|
||||
# 输出rss
|
||||
[outputs]
|
||||
home = ["HTML", "RSS", "Feed"]
|
||||
|
||||
[mediaTypes."application/rss+xml"]
|
||||
suffixes = ["xml"]
|
||||
|
||||
[outputFormats.Feed]
|
||||
mediaType = "application/rss+xml"
|
||||
baseName = "feed"
|
||||
isPlainText = false
|
||||
noUgly = true
|
||||
permalinkable = true
|
||||
|
||||
[outputFormats.RSS]
|
||||
mediaType = "application/rss+xml"
|
||||
baseName = "rss"
|
||||
isPlainText = false
|
||||
noUgly = true
|
||||
permalinkable = true
|
||||
|
||||
# 社交链接列表
|
||||
social = [
|
||||
# GitHub 链接和图标
|
||||
@@ -87,3 +61,24 @@ url = "/archives"
|
||||
extended = false
|
||||
# 最低版本要求
|
||||
min = "0.116.0"
|
||||
|
||||
#输出rss
|
||||
|
||||
[outputs]
|
||||
home = ["HTML", "RSS"]
|
||||
|
||||
[mediaTypes."application/rss+xml"]
|
||||
suffixes = ["xml"]
|
||||
|
||||
[outputFormats.RSS]
|
||||
mediaType = "application/rss+xml"
|
||||
baseName = "rss"
|
||||
isPlainText = false
|
||||
noUgly = true
|
||||
permalinkable = true
|
||||
|
||||
# 分页展示文章数 每页展示文章的数量
|
||||
paginate = 5
|
||||
|
||||
hasCJKLanguage = true
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
{{- /* Generate RSS v2 with full page content. */ -}}
|
||||
{{- /* Upstream Hugo bug - RSS dates can be in future: https://github.com/gohugoio/hugo/issues/3918 */ -}}
|
||||
{{- /* 定义页面上下文 */ -}}
|
||||
{{- $page_context := cond .IsHome site . -}}
|
||||
{{- $pages := $page_context.RegularPages -}}
|
||||
{{- /* 过滤只包含类型为 'post' 的页面 */ -}}
|
||||
{{- $pages = where $pages "Type" "post" -}}
|
||||
{{- $limit := site.Config.Services.RSS.Limit -}}
|
||||
{{- if ge $limit 1 -}}
|
||||
{{- $pages = $pages | first $limit -}}
|
||||
{{- $pages = first $limit $pages -}}
|
||||
{{- end -}}
|
||||
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
|
||||
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>{{ if ne .Title site.Title }}{{ with .Title }}{{.}} | {{ end }}{{end}}{{ site.Title }}</title>
|
||||
@@ -32,7 +34,9 @@
|
||||
<link>{{ .Permalink }}</link>
|
||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||
<guid>{{ .Permalink }}</guid>
|
||||
<description>{{ .Content | html }}</description>
|
||||
<description><![CDATA[
|
||||
{{ .Content | safeHTML }}
|
||||
]]></description>
|
||||
</item>
|
||||
{{ end }}
|
||||
</channel>
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large.
Load diff
|
After Width: | Height: | Size: 2.4 MiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user