From 6f16b3ffe1a89a7ff7ee5e0754b4b39230e979bd Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Wed, 22 Nov 2023 14:57:43 +0800 Subject: [PATCH] :sparkles: Feat: add hiddenFromRss param and front matter --- archetypes/post-bundle/index.md | 1 + archetypes/posts.md | 1 + config.toml | 2 ++ docs | 2 +- layouts/index.rss.xml | 3 ++- 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/archetypes/post-bundle/index.md b/archetypes/post-bundle/index.md index 7c899af7..22447759 100644 --- a/archetypes/post-bundle/index.md +++ b/archetypes/post-bundle/index.md @@ -19,6 +19,7 @@ categories: - draft hiddenFromHomePage: false hiddenFromSearch: false +hiddenFromRss: false summary: resources: - name: featured-image diff --git a/archetypes/posts.md b/archetypes/posts.md index 7548f53d..1e96662e 100644 --- a/archetypes/posts.md +++ b/archetypes/posts.md @@ -19,6 +19,7 @@ categories: - draft hiddenFromHomePage: false hiddenFromSearch: false +hiddenFromRss: false summary: resources: - name: featured-image diff --git a/config.toml b/config.toml index 1716093c..e5fd0c0a 100644 --- a/config.toml +++ b/config.toml @@ -359,6 +359,8 @@ hiddenFromHomePage = false # FixIt 0.2.0 | NEW whether to hide a page from search results hiddenFromSearch = false + # FixIt 0.2.18-lts.5 | NEW whether to hide a page from RSS feed + hiddenFromRss = false # FixIt 0.2.0 | NEW whether to enable twemoji twemoji = false # whether to enable lightgallery diff --git a/docs b/docs index 9e3a5b26..87ddc375 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 9e3a5b26255a75cf42afbf4796a7287f7303b950 +Subproject commit 87ddc375b3c5f7526f5664d06e36c1ac6e45f89d diff --git a/layouts/index.rss.xml b/layouts/index.rss.xml index ef8ee99f..117c4433 100644 --- a/layouts/index.rss.xml +++ b/layouts/index.rss.xml @@ -37,7 +37,8 @@ {{ printf "" .Permalink .MediaType | safeHTML }} {{ end }} {{- range where .Site.RegularPages "Type" "posts" | first (.Site.Params.home.rss | default 10) -}} - {{- if .Params.password }}{{ continue }}{{ end -}} + {{- $params := .Scratch.Get "params" -}} + {{- if $params.password | or $params.hiddenFromRss }}{{ continue }}{{ end -}} {{- dict "Page" . "Site" .Site | partial "rss/item.html" -}} {{- end -}}