Add modified time, fix translations, make reading time optional

This commit is contained in:
halogenica 2017-12-28 00:11:07 -08:00
commit e0a5a06ce1
10 changed files with 28 additions and 3 deletions

View file

@ -1,6 +1,14 @@
<span class="post-meta">
<i class="fa fa-calendar-o"></i>&nbsp;{{ default (i18n "dateFormat") .Site.Params.dateformat | .Date.Format | i18n "postedOnDate" }}
&nbsp;|&nbsp; <i class="fa fa-clock-o"></i>{{ i18n "readingTime"}} {{ .ReadingTime }} {{ i18n "readTime" }} ({{ .WordCount }} {{ i18n "words" }})
{{ $lastmodstr := default (i18n "dateFormat") .Site.Params.dateformat | .Lastmod.Format }}
{{ $datestr := default (i18n "dateFormat") .Site.Params.dateformat | .Date.Format }}
<i class="fa fa-calendar-o"></i>&nbsp;{{ $datestr | i18n "postedOnDate"}}
{{ if ne $datestr $lastmodstr }}
&nbsp;{{ $lastmodstr | i18n "lastModified" }}
{{ end }}
{{ if .Params.readingTime }}
&nbsp;|&nbsp;
<i class="fa fa-clock-o"></i>{{ i18n "readingTime"}} {{ .ReadingTime }} {{ i18n "readTime" }} ({{ .WordCount }} {{ i18n "words" }})
{{ end }}
{{- if .Site.Params.staticman -}}
&nbsp;|&nbsp; <i class="fa fa-comment-o"></i>
{{ $slug := replace .URL "/" "" }}