mirror of
https://github.com/gethinode/hinode.git
synced 2025-10-12 04:23:14 +00:00
53 lines
2.1 KiB
HTML
53 lines
2.1 KiB
HTML
{{- $metadata := "full" -}}
|
|
{{ if isset .Params "metadata" }}
|
|
{{ $metadata = .Params.metadata }}
|
|
{{ else }}
|
|
{{- with (index site.Params.pages .Type ) -}}
|
|
{{ if isset . "metadata" }}{{ $metadata = (index . "metadata") }}{{ end }}
|
|
{{- end -}}
|
|
{{ end }}
|
|
|
|
{{- $supportedStates := slice "full" "original" "none" -}}
|
|
{{- if not (in $supportedStates $metadata) -}}
|
|
{{- errorf "layout [_default/single/header.html] - Invalid value for param 'metadata': %s" $metadata -}}
|
|
{{- end -}}
|
|
|
|
{{ with .Title }}<p class="display-4 mt-5">{{ . }}</p>{{ end }}
|
|
{{ if ne $metadata "none" }}
|
|
{{ $lastmodstr := (partial "utilities/date.html" (dict "date" .Lastmod "format" "long")) -}}
|
|
{{ $datestr := (partial "utilities/date.html" (dict "date" .Date "format" "long")) -}}
|
|
<small class="text-body-secondary text-uppercase">
|
|
{{ $datestr | i18n "postedOnDate" -}}
|
|
{{ if eq $metadata "full" }}
|
|
{{ if ne $datestr $lastmodstr -}} ({{ $lastmodstr | i18n "lastModified" }}){{ end }}
|
|
{{ end }}
|
|
•
|
|
{{ .ReadingTime | lang.FormatNumber 0 }} {{ i18n "minutesShort" }} {{ i18n "read" }} •
|
|
{{ .WordCount | lang.FormatNumber 0 }} {{ i18n "words" }}
|
|
</small>
|
|
{{ end }}
|
|
|
|
{{- if gt (len (.GetTerms "tags")) 0 -}}
|
|
<div class="mt-3">
|
|
<div class="d-none-dark">
|
|
<div class="hstack gap-1">
|
|
{{ range (.GetTerms "tags") -}}
|
|
{{- $url := .Page.RelPermalink -}}
|
|
{{ partial "assets/button.html" (dict "href" $url "title" .LinkTitle "color" "light" "size" "sm") }}
|
|
{{ end -}}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="d-none-light">
|
|
<div class="hstack gap-1">
|
|
{{ range (.GetTerms "tags") -}}
|
|
{{- $url := .Page.RelPermalink -}}
|
|
{{ partial "assets/button.html" (dict "href" $url "title" .LinkTitle "color" "primary" "size" "sm" "outline" "true") }}
|
|
{{ end -}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{- end -}}
|
|
{{ partial "assets/sharing.html" (dict "page" .) }}
|
|
<p class="lead mb-5 mt-3">{{ .Description }}</p>
|