From f34f7ad13c99a52a5437715f00d286ae24225f25 Mon Sep 17 00:00:00 2001 From: Huy Tran Date: Mon, 30 Jul 2018 07:23:00 +1000 Subject: [PATCH] revises post navigation and post meta templates --- .../{post-meta-top.html => post-meta.html} | 22 +++++++++---------- ...-meta-bottom.html => post-navigation.html} | 7 ++++-- 2 files changed, 16 insertions(+), 13 deletions(-) rename layouts/partials/page-single/{post-meta-top.html => post-meta.html} (72%) rename layouts/partials/page-single/{post-meta-bottom.html => post-navigation.html} (64%) diff --git a/layouts/partials/page-single/post-meta-top.html b/layouts/partials/page-single/post-meta.html similarity index 72% rename from layouts/partials/page-single/post-meta-top.html rename to layouts/partials/page-single/post-meta.html index 1fd8ad9..983d470 100644 --- a/layouts/partials/page-single/post-meta-top.html +++ b/layouts/partials/page-single/post-meta.html @@ -1,21 +1,21 @@ {{ if ne .Params.showpagemeta false }}
- {{ if not .Date.IsZero -}} - {{ .Date.Format (.Site.Params.dateformat | default "Jan 02, 2006") -}} - {{- end }} + {{ if not .Date.IsZero }} + {{ .Date.Format (.Site.Params.dateformat | default "Jan 02, 2006") }} + {{ end }} - {{- with .Params.categories -}} - {{- $total := len . -}} - {{ if gt $total 0 -}} + {{ with .Params.categories }} + {{ $total := len . }} + {{ if gt $total 0 }} in - {{- $total := sub $total 1 -}} - {{- range $i, $cat := sort . }} + {{ $total := sub $total 1 }} + {{ range $i, $cat := sort . }} {{ if lt $i $total }}•{{ end }} - {{- end -}} - {{- end -}} - {{- end -}} + {{ end }} + {{ end }} + {{ end }} {{ with .Params.tags }} {{ $total := len . }} diff --git a/layouts/partials/page-single/post-meta-bottom.html b/layouts/partials/page-single/post-navigation.html similarity index 64% rename from layouts/partials/page-single/post-meta-bottom.html rename to layouts/partials/page-single/post-navigation.html index 1548841..874812b 100644 --- a/layouts/partials/page-single/post-meta-bottom.html +++ b/layouts/partials/page-single/post-navigation.html @@ -1,14 +1,17 @@ +{{ $enabledPostNavigation := .Site.Params.postNavigation | default true }} +{{ if $enabledPostNavigation }}
{{ with .PrevInSection -}} - {{ .Title }} + {{ .Title }} {{- end }} {{ with .NextInSection -}} - {{ .Title }} + {{ .Title }} {{- end }}
+{{ end }}