From 3639584f9e15059d32580e6aab876df061b74023 Mon Sep 17 00:00:00 2001 From: zzossig Date: Fri, 14 Feb 2020 09:35:01 +0900 Subject: [PATCH] [new option] notAllowedTypesInHomeFeed --- README.ko.md | 1 + README.md | 1 + exampleSite/config/_default/params.toml | 1 + layouts/_default/rss.xml | 11 ++++++++++- 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.ko.md b/README.ko.md index 280776a..2923a78 100644 --- a/README.ko.md +++ b/README.ko.md @@ -239,6 +239,7 @@ themeOptions = ["dark", "light", "hacker", "solarized", "kimbie"] # select optio notAllowedTypesInHome = ["contact", "talks", "about", "showcase"] # not allowed page types in home page. type can be set in front matter or default to folder name. notAllowedTypesInHomeSidebar = ["about", "archive", "showcase"] # not allowed page types in home page sidebar(recent post titles). notAllowedTypesInArchive = ["about", "talks", "showcase"] # not allowed page types in archive page +notAllowedTypesInHomeFeed = ["about", "archive", "contact", "talks", "showcase", "publication", "presentation", "resume", "gallery"] # header homeHeaderType = "text" # text, img, slide diff --git a/README.md b/README.md index 6082c46..120e68b 100644 --- a/README.md +++ b/README.md @@ -247,6 +247,7 @@ themeOptions = ["dark", "light", "hacker", "solarized", "kimbie"] # select optio notAllowedTypesInHome = ["contact", "talks", "about", "showcase"] # not allowed page types in home page. type can be set in front matter or default to folder name. notAllowedTypesInHomeSidebar = ["about", "archive", "showcase"] # not allowed page types in home page sidebar(recent post titles). notAllowedTypesInArchive = ["about", "talks", "showcase"] # not allowed page types in archive page +notAllowedTypesInHomeFeed = ["about", "archive", "contact", "talks", "showcase", "publication", "presentation", "resume", "gallery"] # header homeHeaderType = "text" # text, img, slide diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index 1b6f348..4ffcb41 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -9,6 +9,7 @@ themeOptions = ["dark", "light", "hacker", "solarized", "kimbie"] notAllowedTypesInHome = ["contact", "talks", "about", "showcase", "publication", "presentation", "resume"] notAllowedTypesInHomeSidebar = ["about", "archive", "showcase", "publication", "presentation", "resume"] notAllowedTypesInArchive = ["about", "talks", "showcase", "publication", "presentation", "resume"] +notAllowedTypesInHomeFeed = ["about", "archive", "contact", "talks", "showcase", "publication", "presentation", "resume", "gallery"] # header homeHeaderType = "text" # text, img, slide diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index db61c70..70d5944 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -15,7 +15,13 @@ {{ end }} {{ if .IsHome }} - {{ range .Site.RegularPages }} + + {{ $filteredPages := .Site.RegularPages }} + {{ range $.Param "notAllowedTypesInHomeFeed" }} + {{ $filteredPages = (where $filteredPages "Type" "!=" (lower .)) }} + {{ end }} + + {{ range $filteredPages }} {{ .Title }} {{ .Permalink }} @@ -25,7 +31,9 @@ {{ .Summary | html }} {{ end }} + {{ else }} + {{ range .Pages }} {{ .Title }} @@ -36,6 +44,7 @@ {{ .Summary | html }} {{ end }} + {{ end }} \ No newline at end of file