From 16213a37e5e6748e0951e0547402996317238856 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Thu, 22 Oct 2020 20:39:45 +0530 Subject: [PATCH] post-meta: improvements - hide zero date (closes #33) - fix separator - refactor --- layouts/partials/post_meta.html | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/layouts/partials/post_meta.html b/layouts/partials/post_meta.html index dd3b9a5c..479ab897 100644 --- a/layouts/partials/post_meta.html +++ b/layouts/partials/post_meta.html @@ -1,5 +1,11 @@ - -{{- if $.Site.Params.ShowReadingTime -}} ·  -{{- $default_txt := print .ReadingTime " " "min" }} -{{- i18n "read_time" .ReadingTime | default $default_txt }}{{ end }} -{{- if or .Params.author .Site.Params.author }} · {{- .Params.author | default .Site.Params.author }}{{ end }} +{{- if not .Date.IsZero -}} + ·  +{{- end -}} + +{{- if $.Site.Params.ShowReadingTime -}} +{{- i18n "read_time" .ReadingTime | default (printf "%s min" .ReadingTime) }} ·  +{{- end -}} + +{{- if or .Params.author .Site.Params.author }} +{{- printf "%s" (.Params.author | default .Site.Params.author) }} +{{- end -}}