Merge pull request #128 from yogster/master
Fixes https://github.com/halogenica/beautifulhugo/issues/111
This commit is contained in:
commit
7cb1aa8aea
2 changed files with 18 additions and 14 deletions
|
|
@ -12,15 +12,17 @@
|
||||||
{{- if .Site.Params.staticman -}}
|
{{- if .Site.Params.staticman -}}
|
||||||
| <i class="fa fa-comment-o"></i>
|
| <i class="fa fa-comment-o"></i>
|
||||||
{{ $slug := replace .URL "/" "" }}
|
{{ $slug := replace .URL "/" "" }}
|
||||||
{{ $comments := index $.Site.Data.comments $slug }}
|
{{ if .Site.Data.comments }}
|
||||||
{{ if $comments }}
|
{{ $comments := index $.Site.Data.comments $slug }}
|
||||||
{{ if gt (len $comments) 1 }}
|
{{ if $comments }}
|
||||||
{{ len $comments }} {{ i18n "moreComment" }}
|
{{ if gt (len $comments) 1 }}
|
||||||
|
{{ len $comments }} {{ i18n "moreComment" }}
|
||||||
|
{{ else }}
|
||||||
|
{{ len $comments }} {{ i18n "oneComment" }}
|
||||||
|
{{ end }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ len $comments }} {{ i18n "oneComment" }}
|
0 {{ i18n "oneComment" }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ else }}
|
|
||||||
0 {{ i18n "oneComment" }}
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if .IsTranslated -}}
|
{{ if .IsTranslated -}}
|
||||||
|
|
|
||||||
|
|
@ -2,15 +2,17 @@
|
||||||
|
|
||||||
{{ $slug := replace .URL "/" "" }}
|
{{ $slug := replace .URL "/" "" }}
|
||||||
|
|
||||||
{{ $comments := index $.Site.Data.comments $slug }}
|
{{ if .Site.Data.comments }}
|
||||||
{{ if $comments }}
|
{{ $comments := index $.Site.Data.comments $slug }}
|
||||||
{{ if gt (len $comments) 1 }}
|
{{ if $comments }}
|
||||||
<h3>{{ len $comments }} {{ i18n "moreComment" }}</h3>
|
{{ if gt (len $comments) 1 }}
|
||||||
|
<h3>{{ len $comments }} {{ i18n "moreComment" }}</h3>
|
||||||
|
{{ else }}
|
||||||
|
<h3>{{ len $comments }} {{ i18n "oneComment" }}</h3>
|
||||||
|
{{ end }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<h3>{{ len $comments }} {{ i18n "oneComment" }}</h3>
|
<h3>{{ i18n "noComment" }}</h3>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ else }}
|
|
||||||
<h3>{{ i18n "noComment" }}</h3>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ $.Scratch.Set "hasComments" 0 }}
|
{{ $.Scratch.Set "hasComments" 0 }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue