diff options
author | Angelo Stavrow <contact@angelostavrow.com> | 2019-09-30 15:25:19 +0300 |
---|---|---|
committer | Angelo Stavrow <contact@angelostavrow.com> | 2019-09-30 15:25:19 +0300 |
commit | 1848457904ec73625421874db40c2f7a19559d59 (patch) | |
tree | c7dfe8c4aea4d6f8b37d271521dbd3eec32c9d3d | |
parent | 6b3f07ce9591e8304f1669e5fa87703d16bbdabc (diff) |
Use mainSections configuration parameter in list templates (#56)
-rw-r--r-- | config.toml.example | 1 | ||||
-rw-r--r-- | layouts/_default/list.html | 2 | ||||
-rw-r--r-- | layouts/index.html | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/config.toml.example b/config.toml.example index 5e9e402..7d4cac3 100644 --- a/config.toml.example +++ b/config.toml.example @@ -12,6 +12,7 @@ theme = "indigo" Biography = "A short description, a few sentences describing the author. Set the 'ShowBio' parameter to false to hide this." ShowBio = true PermalinkText = "🔗" + mainSections = ["post"] # Contact/social-network identifiers for social icons EmailAddress = "email.address@example.com" diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 4af97c7..c975ac5 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,7 +1,7 @@ {{ partial "header.html" . }} <h2>{{ .Title }}</h2> <div id="content"> -{{ range $index, $page := (.Paginate (where .Site.RegularPages "Type" "post")).Pages }} +{{ range $index, $page := (.Paginate (where .Site.RegularPages "Type" "in" site.Params.mainSections)).Pages }} {{ if ne $index 0 }} {{ end }} {{ .Render "li" }} diff --git a/layouts/index.html b/layouts/index.html index 4e973ac..3b02c07 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -3,7 +3,7 @@ <!-- Content goes here --> <div id="content"> -{{ range $index, $page := (.Paginate (where (where .Site.RegularPages "Type" "post") ".Params.hidden" "!=" "true" )).Pages }} +{{ range $index, $page := (.Paginate (where (where .Site.RegularPages "Type" "in" site.Params.mainSections) ".Params.hidden" "!=" "true" )).Pages }} {{ if ne $index 0 }} {{ end }} {{ .Render "li" }} |