Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jbub/ghostwriter.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuraj Bubniak <juraj.bubniak@exponea.com>2019-08-17 19:58:32 +0300
committerJuraj Bubniak <juraj.bubniak@exponea.com>2019-08-17 19:58:32 +0300
commit6e9eabc9ce50c6240581fa2908c47b2cc0f2db95 (patch)
treeee184c3d580471f52c0440fb67f6fc8eb7c5acc5
parent6a7a274c081a957920e74f3de16b5640cf173a0a (diff)
Use mainSections param to allow portable filtering of pages on home page.
-rw-r--r--README.md1
-rw-r--r--exampleSite/config.toml1
-rw-r--r--layouts/_default/list.html2
-rw-r--r--layouts/index.html2
-rw-r--r--layouts/post/list.html2
5 files changed, 5 insertions, 3 deletions
diff --git a/README.md b/README.md
index 21cec61..0991953 100644
--- a/README.md
+++ b/README.md
@@ -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 }}