diff options
author | Dillon <dillonzq@outlook.com> | 2020-05-18 11:10:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-18 11:10:24 +0300 |
commit | 9c1244490f0f5596db9b6df933041af9c727dc5b (patch) | |
tree | 57c4af8cb68299ba371738b7946a22fb15d97d33 /layouts/_default/summary.html | |
parent | 36f59a72ee4c186cc525b67da6813498f43a711c (diff) |
i18n: update i18n string format (#371)
Diffstat (limited to 'layouts/_default/summary.html')
-rw-r--r-- | layouts/_default/summary.html | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 7f4c12d..fa990e1 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -23,22 +23,20 @@ {{- partial "plugin/link.html" $options -}} </span> - {{- $publish_date := .PublishDate.Format (.Site.Params.dateFormat | default "2006-01-02") -}} - <span class="post-publish"> - {{ T "publish" }} <time datetime={{ $publish_date }}>{{ $publish_date }}</time> - </span> + {{- with .Site.Params.dateFormat | default "2006-01-02" | .PublishDate.Format -}} + <span class="post-publish"> + {{- printf `<time datetime="%v">%v</time>` . . | dict "Date" | T "publishedOnDate" | safeHTML -}} + </span> + {{- end -}} - {{- with .Params.categories -}} - - <span class="post-category"> - {{- T "included" -}} - {{- range $index, $value := . -}} - {{- if gt $index 0 }} {{ end -}} - {{- $category := $value | anchorize | printf "/categories/%s" | $.Site.GetPage -}} - <a href="{{ $category.RelPermalink }}"> - <i class="far fa-folder fa-fw"></i>{{ $category.Title }} - </a> - {{- end -}} + {{- $categories := slice -}} + {{- range .Params.categories -}} + {{- $category := . | anchorize | printf "/categories/%v" | $.Site.GetPage -}} + {{- $categories = $categories | append (printf `<a href="%v"><i class="far fa-folder fa-fw"></i>%v</a>` $category.RelPermalink $category.Title) -}} + {{- end -}} + {{- with delimit $categories " " -}} + <span class="post-category"> + {{- dict "Categories" . | T "includedInCategories" | safeHTML -}} </span> {{- end -}} </div> @@ -60,7 +58,7 @@ <i class="fas fa-tags fa-fw"></i> {{- range $index, $value := . -}} {{- if gt $index 0 }}, {{ end -}} - {{- $tag := $value | anchorize | printf "/tags/%s" | $.Site.GetPage -}} + {{- $tag := $value | anchorize | printf "/tags/%v" | $.Site.GetPage -}} <a href="{{ $tag.RelPermalink }}">{{ $tag.Title }}</a> {{- end -}} </div> |