mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-13 20:14:15 +00:00
See https://discord.com/channels/722225264733716590/738924091511144489/1406144559188283494 See https://gohugo.io/templates/new-templatesystem-overview/
68 lines
2.3 KiB
HTML
68 lines
2.3 KiB
HTML
{{ $is_list := .is_list }}
|
|
{{ $page := .page }}
|
|
|
|
<div class="article-metadata">
|
|
|
|
{{/* If `authors` is set and is not empty. */}}
|
|
{{ if $page.Params.authors }}
|
|
{{ $authorLen := len $page.Params.authors }}
|
|
{{ if gt $authorLen 0 }}
|
|
<div>
|
|
{{ partial "page_metadata_authors" $page }}
|
|
</div>
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ if not (in (slice "event" "page") $page.Type) | and (ne $page.Params.show_date false) }}
|
|
<span class="article-date">
|
|
{{ $date := $page.Lastmod | time.Format site.Params.locale.date_format }}
|
|
{{ if eq $page.Type "publication" }}
|
|
{{ $date = $page.Date | time.Format (site.Params.publications.date_format | default "January, 2006") }}
|
|
{{ else }}
|
|
{{ if ne $page.Params.Lastmod $page.Params.Date }}
|
|
{{ i18n "last_updated" }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ $date }}
|
|
</span>
|
|
{{ end }}
|
|
|
|
{{ if and (eq $is_list 1) (eq $page.Type "publication") }}
|
|
<span class="middot-divider"></span>
|
|
<span class="pub-publication">
|
|
{{ if $page.Params.publication_short }}
|
|
{{ $page.Params.publication_short | markdownify }}
|
|
{{ else if $page.Params.publication }}
|
|
{{ $page.Params.publication | markdownify }}
|
|
{{ end }}
|
|
</span>
|
|
{{ end }}
|
|
|
|
{{ if and (eq $page.Type "post") (not (or (eq site.Params.reading_time false) (eq $page.Params.reading_time false))) }}
|
|
<span class="middot-divider"></span>
|
|
<span class="article-reading-time">
|
|
{{ $page.ReadingTime }} {{ i18n "minute_read" }}
|
|
</span>
|
|
{{ end }}
|
|
|
|
{{/* Show Disqus comment count if enabled. */}}
|
|
{{ $comments_provider := trim (site.Params.features.comment.provider | lower) " " }}
|
|
{{ $commentable_page := $page.Params.commentable }}
|
|
{{ if (eq $comments_provider "disqus") | and (site.Params.features.comment.disqus.show_count | default true) | and $commentable_page }}
|
|
<span class="middot-divider"></span>
|
|
<a href="{{ $page.RelPermalink }}#disqus_thread"><!-- Count will be inserted here --></a>
|
|
{{ end}}
|
|
|
|
{{ if $page.Params.categories }}
|
|
<span class="middot-divider"></span>
|
|
<span class="article-categories">
|
|
<i class="fas fa-folder mr-1"></i>
|
|
{{- range $index, $value := ($page.GetTerms "categories") -}}
|
|
{{- if gt $index 0 }}, {{ end -}}
|
|
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
|
|
{{- end -}}
|
|
</span>
|
|
{{ end }}
|
|
|
|
</div>
|