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

github.com/vickylaixy/hugo-theme-introduction.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Martin Viva <pmviva@gmail.com>2017-12-05 07:04:11 +0300
committerVicky Lai <vicky@vickylai.io>2017-12-05 07:04:11 +0300
commitce5aaa62678d1097e686ebf8a99b8c276b235e1b (patch)
tree71a4881788e5ad00af60c49801871dbb0a306c0d
parent423d2dbe8973551306fb34eb59c0438e04e58534 (diff)
Fixed issue #15 (#16)
Fix for blog posts ordered by date as of Hugo v0.31.
-rw-r--r--layouts/blog/list.html4
-rw-r--r--layouts/partials/blogsection.html4
2 files changed, 4 insertions, 4 deletions
diff --git a/layouts/blog/list.html b/layouts/blog/list.html
index 80d9029..cf32272 100644
--- a/layouts/blog/list.html
+++ b/layouts/blog/list.html
@@ -17,7 +17,7 @@
{{ if .Site.Params.showlatest }}
<h2 class="title is-2 top-pad">Latest Post</h2>
- {{ range first 1 (where .Data.Pages.ByPublishDate "Section" "blog") }}
+ {{ range first 1 (where .Data.Pages.ByPublishDate.Reverse "Section" "blog") }}
<div class="summary">{{ .Date.Format .Site.Params.dateform }}
<h3 class="title is-3 strong-post-title"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
<div class="markdown">
@@ -63,4 +63,4 @@ $('a[href^="{{ .Permalink }}#"]').click(function(e) {
})
</script>
-</body> \ No newline at end of file
+</body>
diff --git a/layouts/partials/blogsection.html b/layouts/partials/blogsection.html
index 9693210..995b04b 100644
--- a/layouts/partials/blogsection.html
+++ b/layouts/partials/blogsection.html
@@ -2,7 +2,7 @@
{{ if .Site.Params.showlatest }}
<h2 class="title is-2 has-text-centered">Latest Post</h2>
- {{ range first 1 (where .Data.Pages.ByPublishDate "Section" "blog") }}
+ {{ range first 1 (where .Data.Pages.ByPublishDate.Reverse "Section" "blog") }}
<div class="summary">{{ .Date.Format .Site.Params.dateform }}
<h3 class="title is-3 latest-post-title"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
<div class="markdown">
@@ -30,4 +30,4 @@
</div><!-- End Blog container -->
-<div class="container has-text-centered top-pad"><a href="#top"><i class="fa fa-arrow-up"></i></a></div> \ No newline at end of file
+<div class="container has-text-centered top-pad"><a href="#top"><i class="fa fa-arrow-up"></i></a></div>