diff --git a/hugo.toml b/hugo.toml index c5b909c86..390bb6a00 100644 --- a/hugo.toml +++ b/hugo.toml @@ -509,8 +509,12 @@ enableEmoji = true paginate = 20 # date format (month and day) dateFormat = "01-02" - # amount of RSS pages - rss = 10 + # FixIt 0.3.10 | NEW Section feed config for RSS, Atom and JSON feed. + [params.section.feed] + # The number of posts to include in the feed. Default is -1, which means all posts. + limit = -1 + # whether to show the full text content in feed. + fullText = false # FixIt 0.2.13 | NEW recently updated pages config # TODO refactor to support archives, section, taxonomy and term [params.section.recentlyUpdated] @@ -519,14 +523,18 @@ enableEmoji = true days = 30 maxCount = 10 - # List (category or tag) page config + # Term list (category or tag) page config [params.list] # special amount of posts in each list page paginate = 20 # date format (month and day) dateFormat = "01-02" - # amount of RSS pages - rss = 10 + # FixIt 0.3.10 | NEW Term list feed config for RSS, Atom and JSON feed. + [params.list.feed] + # The number of posts to include in the feed. Default is -1, which means all posts. + limit = -1 + # whether to show the full text content in feed. + fullText = false # FixIt 0.2.17 | NEW TagCloud config for tags page [params.tagcloud] @@ -538,8 +546,6 @@ enableEmoji = true # Home page config [params.home] - # amount of RSS pages - rss = 10 # Home page profile [params.home.profile] enable = false @@ -820,12 +826,12 @@ enableEmoji = true # "corner-indicator", "fill-left", "flash", "flat-top", "loading-bar", "mac-osx", "material", "minimal"] theme = "minimal" - # FixIt 0.3.10 | NEW Feed config for RSS, Atom and JSON feed. + # FixIt 0.3.10 | NEW Global Feed config for RSS, Atom and JSON feed. [params.feed] # The number of posts to include in the feed. Default is -1, which means all posts. - limit = -1 + limit = 10 # whether to show the full text content in feed. - fullText = false + fullText = true # FixIt 0.2.15 | NEW Developer options # Select the scope named `public_repo` to generate personal access token, @@ -843,10 +849,10 @@ enableEmoji = true hiddenFromHomePage = false # whether to hide a page from search results hiddenFromSearch = false - # FixIt 0.3.0 | NEW whether to hide a page from RSS feed - hiddenFromRss = false # FixIt 0.3.0 | NEW whether to hide a page from related posts hiddenFromRelated = false + # FixIt 0.3.10 | NEW whether to hide a page from RSS, Atom and JSON feed + hiddenFromFeed = false # whether to enable twemoji twemoji = false # FixIt 0.2.18 | CHANGED whether to enable lightgallery diff --git a/layouts/partials/feed/rss.html b/layouts/partials/feed/rss.html index d3d969d87..901536d64 100644 --- a/layouts/partials/feed/rss.html +++ b/layouts/partials/feed/rss.html @@ -3,9 +3,8 @@ {{- $pages = where $pages "Params.password" "eq" nil -}} {{- /* Front matter: hiddenFromFeed */ -}} {{- $pages = where $pages "Params.hiddenFromFeed" "ne" true -}} -{{- $limit := .Site.Params.feed.limit -}} -{{- if ge $limit 1 -}} - {{- $pages = $pages | first $limit -}} +{{- if ge .Config.limit 1 -}} + {{- $pages = $pages | first .Config.limit -}} {{- end -}} {{- $length := $pages.Len -}} {{- /* TODO 文章内图片链接、分类、标签等处理 */ -}} @@ -27,7 +26,7 @@ {{- end }} {{- range $page := $pages }} {{- $params := .Params | merge .Site.Params.Page }} - {{- $fullText := (.Param "feed").fullText }} + {{- $fullText := ((.Params.feed | default dict) | merge $.Config ).fullText }} {{- $author := partial "function/get-author-map.html" .Params.author }} {{- $image := $params.featuredimagepreview | default $params.featuredimage }} {{- with $image }} diff --git a/layouts/partials/init/index.html b/layouts/partials/init/index.html index bd783bfb8..de746d152 100644 --- a/layouts/partials/init/index.html +++ b/layouts/partials/init/index.html @@ -1,4 +1,4 @@ -{{- .Scratch.Set "version" "v0.3.10-5a715ca9" -}} +{{- .Scratch.Set "version" "v0.3.10-7e22c336" -}} {{- .Scratch.Set "this" dict -}} {{- partial "init/detection-env.html" . -}} diff --git a/layouts/rss.xml b/layouts/rss.xml index 81a2adabf..8348e8862 100644 --- a/layouts/rss.xml +++ b/layouts/rss.xml @@ -1,4 +1,4 @@ -{{- $options := dict "Site" .Site "OutputFormats" .OutputFormats -}} +{{- $options := dict "Site" .Site "Config" .Site.Params.feed "OutputFormats" .OutputFormats -}} {{- $options = dict "Permalink" .Permalink "Version" (.Scratch.Get "version") | merge $options -}} {{- $options = dict "Title" .Site.Title "Pages" (.Scratch.Get "mainSectionPages") | merge $options -}} {{- partial "feed/rss.html" $options -}} diff --git a/layouts/section/rss.xml b/layouts/section/rss.xml index 726cd5a49..c487b0491 100644 --- a/layouts/section/rss.xml +++ b/layouts/section/rss.xml @@ -2,7 +2,8 @@ {{- if .Site.Params.withSiteTitle -}} {{- $title = printf "%s %s %s" $title .Site.Params.titleDelimiter .Site.Title -}} {{- end -}} -{{- $options := dict "Site" .Site "OutputFormats" .OutputFormats -}} +{{- $config := (.Params.feed | default dict) | merge .Site.Params.section.feed | merge .Site.Params.feed -}} +{{- $options := dict "Site" .Site "Config" $config "OutputFormats" .OutputFormats -}} {{- $options = dict "Permalink" .Permalink "Version" (.Scratch.Get "version") | merge $options -}} {{- $options = dict "Title" $title "Pages" .Pages | merge $options -}} {{- partial "feed/rss.html" $options -}} diff --git a/layouts/taxonomy/rss.xml b/layouts/taxonomy/rss.xml index 8a2d734cb..0f25d57f1 100644 --- a/layouts/taxonomy/rss.xml +++ b/layouts/taxonomy/rss.xml @@ -1,8 +1,9 @@ -{{- $title := printf "%s %s" .Title (T .Data.Singular | default .Data.Singular) -}} +{{- $title := printf "%s - %s" .Title (T .Data.Singular | default .Data.Singular) -}} {{- if .Site.Params.withSiteTitle -}} {{- $title = printf "%s %s %s" $title .Site.Params.titleDelimiter .Site.Title -}} {{- end -}} -{{- $options := dict "Site" .Site "OutputFormats" .OutputFormats -}} +{{- $config := (.Params.feed | default dict) | merge .Site.Params.list.feed | merge .Site.Params.feed -}} +{{- $options := dict "Site" .Site "Config" $config "OutputFormats" .OutputFormats -}} {{- $options = dict "Permalink" .Permalink "Version" (.Scratch.Get "version") | merge $options -}} {{- $options = dict "Title" $title "Pages" .Pages | merge $options -}} {{- partial "feed/rss.html" $options -}}