diff options
author | Juraj Bubniak <juraj.bubniak@exponea.com> | 2019-08-17 19:58:32 +0300 |
---|---|---|
committer | Juraj Bubniak <juraj.bubniak@exponea.com> | 2019-08-17 19:58:32 +0300 |
commit | 6e9eabc9ce50c6240581fa2908c47b2cc0f2db95 (patch) | |
tree | ee184c3d580471f52c0440fb67f6fc8eb7c5acc5 | |
parent | 6a7a274c081a957920e74f3de16b5640cf173a0a (diff) |
Use mainSections param to allow portable filtering of pages on home page.
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | exampleSite/config.toml | 1 | ||||
-rw-r--r-- | layouts/_default/list.html | 2 | ||||
-rw-r--r-- | layouts/index.html | 2 | ||||
-rw-r--r-- | layouts/post/list.html | 2 |
5 files changed, 5 insertions, 3 deletions
@@ -64,6 +64,7 @@ disqusShortname = "XXX" tag = "tags" [Params] + mainSections = ["post"] intro = true headline = "My headline" description = "My description" diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 3c36bc4..a36de5a 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -24,6 +24,7 @@ googleAnalytics = "XXX" tag = "tags" [Params] + mainSections = ["post"] intro = true headline = "Ghostwriter example" description = "Ghostwriter example description" diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 4dfd54b..bc90a74 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -4,7 +4,7 @@ {{ partial "intro.html" . }} <ol class="post-list"> - {{ $pag := .Paginate .Data.Pages }} + {{ $pag := .Paginate .Pages }} {{ range $pag.Pages }} {{ partial "page-stub.html" . }} {{ end }} diff --git a/layouts/index.html b/layouts/index.html index 70190f9..5611e93 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -4,7 +4,7 @@ {{ partial "intro.html" . }} <ol class="post-list"> - {{ $pag := .Paginate (where .Data.Pages "Type" "post") }} + {{ $pag := .Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }} {{ range $pag.Pages }} {{ partial "post-stub.html" . }} {{ end }} diff --git a/layouts/post/list.html b/layouts/post/list.html index aa341ba..aec46fe 100644 --- a/layouts/post/list.html +++ b/layouts/post/list.html @@ -4,7 +4,7 @@ {{ partial "intro.html" . }} <ol class="post-list"> - {{ $pag := .Paginate .Data.Pages }} + {{ $pag := .Paginate .Pages }} {{ range $pag.Pages }} {{ partial "post-stub.html" . }} {{ end }} |