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

github.com/djuelg/Shapez-Theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Juelg <djuelg@gmx.de>2016-05-22 14:58:21 +0300
committerDominik Juelg <djuelg@gmx.de>2016-05-22 14:58:21 +0300
commit92c75f7fa562825427c8ecc6d4d5bf4c66d1a4b7 (patch)
tree11832dbf86514caf278a3f9a5927db00189699a7
parentcd92f4eefcbf3d8950baa4c9730f291797b66004 (diff)
fixed pagination bug, to apply x articles per page AND sort by date
-rw-r--r--exampleSite/config.toml3
-rw-r--r--layouts/index.html2
-rw-r--r--sample-config.toml3
3 files changed, 5 insertions, 3 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 23e74df..1037745 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -10,7 +10,6 @@ copyright = "Copyright (c) 2016, djuelg; all rights reserved."
languageCode = "en-US"
MetaDataFormat = "toml"
-paginate = 8
PaginatePath = "page"
googleAnalytics = ""
@@ -35,4 +34,6 @@ googleAnalytics = ""
logo = "images/logo.png"
logo_start_screen_rotation = "19"
+ # This is a workaround to the original paginate param, to apply x articles per page AND sort by date
+ paginate = 2
keywords = "hugo, blog, Shapez, SVG, design" \ No newline at end of file
diff --git a/layouts/index.html b/layouts/index.html
index 12b3c31..75cfad0 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -24,7 +24,7 @@
</div>
{{ end }}
- {{ $paginator := .Paginate (where .Data.Pages "Type" "post") }}
+ {{ $paginator := .Paginate (where .Data.Pages "Type" "post") .Site.Params.paginate }}
{{ range $paginator.Pages.ByDate.Reverse }}
<div class="timeline-post">
<div class="publish-date">
diff --git a/sample-config.toml b/sample-config.toml
index 23e74df..1037745 100644
--- a/sample-config.toml
+++ b/sample-config.toml
@@ -10,7 +10,6 @@ copyright = "Copyright (c) 2016, djuelg; all rights reserved."
languageCode = "en-US"
MetaDataFormat = "toml"
-paginate = 8
PaginatePath = "page"
googleAnalytics = ""
@@ -35,4 +34,6 @@ googleAnalytics = ""
logo = "images/logo.png"
logo_start_screen_rotation = "19"
+ # This is a workaround to the original paginate param, to apply x articles per page AND sort by date
+ paginate = 2
keywords = "hugo, blog, Shapez, SVG, design" \ No newline at end of file