diff options
author | digitalcraftsman <digitalcraftsman@protonmail.com> | 2017-05-19 23:18:32 +0300 |
---|---|---|
committer | digitalcraftsman <digitalcraftsman@protonmail.com> | 2017-05-19 23:18:32 +0300 |
commit | 0928ac7868816f52541d07a2a66a4038c54de344 (patch) | |
tree | 29c8b9b93aa4123c34fd84eb6036e5ad1fb1a028 | |
parent | 183f569749f8051e609c36a57f417124f02a21f7 (diff) |
Use mainSections to define which pages are shown on the homepage
-rw-r--r-- | exampleSite/config.toml | 3 | ||||
-rw-r--r-- | layouts/partials/article_list.html | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 86a7fdd..ee11f32 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -28,6 +28,9 @@ themesDir = "../.." logo = "css/images/logo.png" disable_mathjax = false # set to true to disable MathJax + # define which types of pages should be shown. By default the type with the most regular pages + mainSections = ["post"] + # Format dates with Go's time formatting date_format = "2006-01-02" diff --git a/layouts/partials/article_list.html b/layouts/partials/article_list.html index af28570..5e42ee5 100644 --- a/layouts/partials/article_list.html +++ b/layouts/partials/article_list.html @@ -1,5 +1,5 @@ <section id="main"> - {{ $paginator := .Paginate (where .Site.RegularPages "Type" "post") }} + {{ $paginator := .Paginate (where .Site.Pages "Section" "in" .Site.Params.mainSections) }} {{ range $paginator.Pages }} <article class="article article-type-post" itemscope="" itemprop="blogPost"> <div class="article-inner"> |