[new option] notAllowedTypesInHomeFeed

This commit is contained in:
zzossig 2020-02-14 09:35:01 +09:00
parent 3228b4eae4
commit 3639584f9e
4 changed files with 13 additions and 1 deletions

View File

@ -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. 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). 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 notAllowedTypesInArchive = ["about", "talks", "showcase"] # not allowed page types in archive page
notAllowedTypesInHomeFeed = ["about", "archive", "contact", "talks", "showcase", "publication", "presentation", "resume", "gallery"]
# header # header
homeHeaderType = "text" # text, img, slide homeHeaderType = "text" # text, img, slide

View File

@ -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. 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). 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 notAllowedTypesInArchive = ["about", "talks", "showcase"] # not allowed page types in archive page
notAllowedTypesInHomeFeed = ["about", "archive", "contact", "talks", "showcase", "publication", "presentation", "resume", "gallery"]
# header # header
homeHeaderType = "text" # text, img, slide homeHeaderType = "text" # text, img, slide

View File

@ -9,6 +9,7 @@ themeOptions = ["dark", "light", "hacker", "solarized", "kimbie"]
notAllowedTypesInHome = ["contact", "talks", "about", "showcase", "publication", "presentation", "resume"] notAllowedTypesInHome = ["contact", "talks", "about", "showcase", "publication", "presentation", "resume"]
notAllowedTypesInHomeSidebar = ["about", "archive", "showcase", "publication", "presentation", "resume"] notAllowedTypesInHomeSidebar = ["about", "archive", "showcase", "publication", "presentation", "resume"]
notAllowedTypesInArchive = ["about", "talks", "showcase", "publication", "presentation", "resume"] notAllowedTypesInArchive = ["about", "talks", "showcase", "publication", "presentation", "resume"]
notAllowedTypesInHomeFeed = ["about", "archive", "contact", "talks", "showcase", "publication", "presentation", "resume", "gallery"]
# header # header
homeHeaderType = "text" # text, img, slide homeHeaderType = "text" # text, img, slide

View File

@ -15,7 +15,13 @@
{{ end }} {{ end }}
{{ if .IsHome }} {{ if .IsHome }}
{{ range .Site.RegularPages }}
{{ $filteredPages := .Site.RegularPages }}
{{ range $.Param "notAllowedTypesInHomeFeed" }}
{{ $filteredPages = (where $filteredPages "Type" "!=" (lower .)) }}
{{ end }}
{{ range $filteredPages }}
<item> <item>
<title>{{ .Title }}</title> <title>{{ .Title }}</title>
<link>{{ .Permalink }}</link> <link>{{ .Permalink }}</link>
@ -25,7 +31,9 @@
<description>{{ .Summary | html }}</description> <description>{{ .Summary | html }}</description>
</item> </item>
{{ end }} {{ end }}
{{ else }} {{ else }}
{{ range .Pages }} {{ range .Pages }}
<item> <item>
<title>{{ .Title }}</title> <title>{{ .Title }}</title>
@ -36,6 +44,7 @@
<description>{{ .Summary | html }}</description> <description>{{ .Summary | html }}</description>
</item> </item>
{{ end }} {{ end }}
{{ end }} {{ end }}
</channel> </channel>
</rss> </rss>