7
1
mirror of https://gitlab.com/ansol/web-ansol.org.git synced 2024-10-18 14:03:08 +00:00
web-ansol.org/themes/academic/layouts/partials/page_metadata.html

61 lines
2.0 KiB
HTML
Raw Normal View History

2020-06-11 11:46:16 +00:00
{{ $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 "talk" "page") $page.Type) }}
<span class="article-date">
2021-09-30 01:05:18 +00:00
{{ $date := $page.Date.Format site.Params.date_format }}
2020-06-11 11:46:16 +00:00
{{ $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. */}}
{{ $disqus_enabled := eq site.Params.comments.engine 1 | and (index site.Params.comments.commentable $page.Type) | and (ne $page.Params.commentable false) | or $page.Params.commentable }}
{{ if and $disqus_enabled (site.Params.comments.disqus.show_count | default true) }}
<span class="middot-divider"></span>
<a href="{{ $page.RelPermalink }}#disqus_thread"><!-- Count will be inserted here --></a>
{{ end}}
{{ $taxonomy := "categories" }}
{{ if $page.Param $taxonomy }}
<span class="middot-divider"></span>
<span class="article-categories">
<i class="fas fa-folder mr-1"></i>
{{- range $index, $value := ($page.GetTerms $taxonomy) -}}
{{- if gt $index 0 }}, {{ end -}}
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
{{- end -}}
</span>
{{ end }}
</div>