Skip to content
Permalink
Browse files

Use mainSections param to allow portable filtering of pages on home p…

…age.
  • Loading branch information
Juraj Bubniak
Juraj Bubniak committed Aug 17, 2019
1 parent 6a7a274 commit 6e9eabc9ce50c6240581fa2908c47b2cc0f2db95
Showing with 5 additions and 3 deletions.
  1. +1 −0 README.md
  2. +1 −0 exampleSite/config.toml
  3. +1 −1 layouts/_default/list.html
  4. +1 −1 layouts/index.html
  5. +1 −1 layouts/post/list.html
@@ -64,6 +64,7 @@ disqusShortname = "XXX"
tag = "tags"
[Params]
mainSections = ["post"]
intro = true
headline = "My headline"
description = "My description"
@@ -24,6 +24,7 @@ googleAnalytics = "XXX"
tag = "tags"

[Params]
mainSections = ["post"]
intro = true
headline = "Ghostwriter example"
description = "Ghostwriter example description"
@@ -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 }}
@@ -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 }}
@@ -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 }}

0 comments on commit 6e9eabc

Please sign in to comment.
You can’t perform that action at this time.