From 08ae6a7451dc15db09e44a143ca1dae834b12893 Mon Sep 17 00:00:00 2001
From: Alexander Bilz <mail@alexbilz.com>
Date: Mon, 18 May 2020 18:42:42 +0000
Subject: [PATCH] Merge pull request #11 from esttorhe/patch-4
---
exampleSite/config.toml | 1 +
layouts/index.html | 4 ++--
README.md | 7 ++++++-
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 8060624..a394fe3 100644
--- a/README.md
+++ b/README.md
@@ -127,7 +127,12 @@
Content-Security-Policy: base-uri 'self'; connect-src 'self'; default-src 'self'; frame-ancestors 'none'; font-src 'self' stackpath.bootstrapcdn.com; img-src 'self'; object-src 'none'; script-src 'self'; style-src 'self' stackpath.bootstrapcdn.com;
Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
```
-
+### Configurable pagination section
+You can configure the pages shown on the front page by altering the `mainSections` parameter:
+```toml
+[params]
+ mainSections = ["post", "docs"]
+```
## License
Anatole is licensed under the [MIT license](https://github.com/lxndrblz/anatole/blob/master/LICENSE).
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 56c4efa..7262744 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -20,6 +20,7 @@
keywords = ""
favicon = "favicons/"
customCss = []
+mainSections = ["post"]
## Math settings
[params.math]
diff --git a/layouts/index.html b/layouts/index.html
index 7c40447..e7f7e71 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,5 +1,5 @@
{{ define "main" }}
- {{ $paginator := .Paginate (where .Site.RegularPages "Type" "post") }}
+ {{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }}
{{ range $paginator.Pages }}
<div class="post animated fadeInDown">
<div class="post-title">
@@ -25,4 +25,4 @@
<div class="pagination">
{{ template "_internal/pagination.html" . }}
</div>
-{{ end }}
\ No newline at end of file
+{{ end }}
--
Gitblit v1.10.0