Add modified time, fix translations, make reading time optional

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

View File

@ -17,6 +17,7 @@ pygmentCodeFences = true
commit = false
rss = true
comments = true
readingTime = true
# gcse = "012345678901234567890:abcdefghijk" # Get your code from google.com/cse. Make sure to go to "Look and Feel" and change Layout to "Full Width" and Theme to "Classic"
#[[Params.bigimg]]

View File

@ -5,6 +5,8 @@
translation: "2 Jan, 2006 15:04:05"
- id: postedOnDate
translation: "Gepostet am {{ .Count }}"
- id: lastModified
translation: "(Zuletzt geändert am {{ .Count }})"
- id: translationsLabel
translation: "Andere Sprachen: "
- id: translationsSeparator
@ -22,7 +24,7 @@
- id: readTime
translation: "minuten"
- id: words
translation: "wörter"
translation: "Wörter"
# 404 page

View File

@ -5,6 +5,8 @@
translation: "Jan 2, 2006 15:04:05"
- id: postedOnDate
translation: "Posted on {{ .Count }}"
- id: lastModified
translation: "(Last modified on {{ .Count }})"
- id: translationsLabel
translation: "Other languages: "
- id: translationsSeparator

View File

@ -5,6 +5,8 @@
translation: "2 Jan, 2006 15:04:05"
- id: postedOnDate
translation: "Publicado el {{ .Count }}"
- id: lastModified
translation: "(Última modificación en {{ .Count }})"
- id: translationsLabel
translation: "Otros idiomas: "
- id: translationsSeparator

View File

@ -5,6 +5,8 @@
translation: "2 Jan, 2006 15:04:05"
- id: postedOnDate
translation: "Posté le {{ .Count }}"
- id: lastModified
translation: "(Dernière modification le {{ .Count }})"
- id: translationsLabel
translation: "Autres langues: "
- id: translationsSeparator

View File

@ -5,6 +5,8 @@
translation: "2 Jan, 2006 15:04:05"
- id: postedOnDate
translation: "{{ .Count }}に投稿"
- id: lastModified
translation: "(最終更新日時{{ .Count }})"
- id: translationsLabel
translation: "翻訳:"
- id: translationsSeparator

View File

@ -5,6 +5,8 @@
translation: "2 Jan, 2006 15:04:05"
- id: postedOnDate
translation: "Opublikowany {{ .Count }}"
- id: lastModified
translation: "(Ostatnia modyfikacja {{ .Count }})"
- id: translationsLabel
translation: "Inne języki: "
- id: translationsSeparator

View File

@ -5,6 +5,8 @@
translation: "2 Jan, 2006 15:04:05"
- id: postedOnDate
translation: "Опубликовано {{ .Count }}"
- id: lastModified
translation: "(Последнее изменение {{ .Count }})"
- id: translationsLabel
translation: "Другие языки: "
- id: translationsSeparator

View File

@ -5,6 +5,8 @@
translation: "2 Jan, 2006 15:04:05"
- id: postedOnDate
translation: "发表于 {{ .Count }}"
- id: lastModified
translation: "(上次修改时间 {{ .Count }})"
- id: translationsLabel
translation: "其它语言: "
- id: translationsSeparator

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 "/" "" }}