Add more post information, if staticman used, it can show number comments
This commit is contained in:
parent
d68cf2e04d
commit
41667d46c3
10 changed files with 57 additions and 1 deletions
|
|
@ -1,5 +1,20 @@
|
|||
<span class="post-meta">
|
||||
{{ default (i18n "dateFormat") .Site.Params.dateformat | .Date.Format | i18n "postedOnDate" }}
|
||||
<i class="fa fa-calendar-o"></i> {{ default (i18n "dateFormat") .Site.Params.dateformat | .Date.Format | i18n "postedOnDate" }}
|
||||
| <i class="fa fa-clock-o"></i>{{ i18n "readingTime"}} {{ .ReadingTime }} {{ i18n "readTime" }} ({{ .WordCount }} {{ i18n "words" }})
|
||||
{{- if .Site.Params.staticman -}}
|
||||
| <i class="fa fa-comment-o"></i>
|
||||
{{ $slug := replace .URL "/" "" }}
|
||||
{{ $comments := index $.Site.Data.comments $slug }}
|
||||
{{ if $comments }}
|
||||
{{ if gt (len $comments) 1 }}
|
||||
{{ len $comments }} {{ i18n "moreComment" }}
|
||||
{{ else }}
|
||||
{{ len $comments }} {{ i18n "oneComment" }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
0 {{ i18n "oneComment" }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if .IsTranslated -}}
|
||||
{{- $sortedTranslations := sort .Translations "Site.Language.Weight" -}}
|
||||
{{- $links := apply $sortedTranslations "partial" "translation_link.html" "." -}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue