mirror of
https://github.com/foo-dogsquared/hugo-theme-more-contentful.git
synced 2025-01-31 04:58:14 +00:00
39 lines
1.5 KiB
HTML
39 lines
1.5 KiB
HTML
{{- /*
|
|
The component where it will display the metadata of the post.
|
|
*/ -}}
|
|
{{- if or .PublishDate .Lastmod }}
|
|
{{- $RFC3339 := "2006-01-02T15:04:05Z07:00" }}
|
|
<div class="site__list post__meta" aria-hidden="true">
|
|
{{- if .PublishDate -}}
|
|
<span class="post__meta-icon-label">
|
|
{{ partial "components/heroicon.html" (dict "id" "calendar") }}
|
|
<time datetime="{{ .PublishDate.Format $RFC3339 }}" title="{{ i18n "published_on" }}">
|
|
{{ .PublishDate.Format "2006-01-02" }}
|
|
</time>
|
|
</span>
|
|
{{- end }}
|
|
|
|
{{- if ne (.PublishDate.Format "2006-01-02") (.Lastmod.Format "2006-01-02") }}
|
|
<span class="post__meta-icon-label">
|
|
{{ partial "components/heroicon.html" (dict "id" "arrow-path") }}
|
|
<time datetime="{{ .Lastmod.Format $RFC3339 }}" title="{{ i18n "updated_on" }}">
|
|
{{ .Lastmod.Format "2006-01-02" }}
|
|
</time>
|
|
</span>
|
|
{{- end }}
|
|
|
|
{{- /* The authors are appended with 'et al' if there's more than one author in the map. */ -}}
|
|
{{- with .Params.author }}
|
|
{{- $names := slice }}
|
|
{{- range . }}{{ $names = $names | append .name }}{{ end }}
|
|
{{- $author := index (first 1 $names) 0 }}
|
|
<span class="post__meta-icon-label" data-authors="{{ jsonify $names }}" title="{{ i18n "published_by" }}">
|
|
{{ partial "components/heroicon.html" (dict "id" "pencil") }}
|
|
<span>
|
|
{{ $author }}{{ if ge (len .) 2 }}, et al.{{ end }}
|
|
</span>
|
|
</span>
|
|
{{- end }}
|
|
</div>
|
|
{{- end }}
|