mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
57 lines
No EOL
1.9 KiB
HTML
57 lines
No EOL
1.9 KiB
HTML
{{- /* based on Hugo 0.125.5 schema.html */}}
|
|
{{- with partial "pageHelper/title.hugo" (dict "page" . "fullyQualified" true "reverse" true) | plainify }}
|
|
<meta itemprop="name" content="{{ . }}">
|
|
{{- end }}
|
|
|
|
{{- with or .Description .Summary | plainify | htmlUnescape | chomp }}
|
|
<meta itemprop="description" content="{{ . }}">
|
|
{{- end }}
|
|
|
|
{{- $ISO8601 := "2006-01-02T15:04:05-07:00" }}
|
|
{{- with or .PublishDate .Date }}
|
|
<meta itemprop="datePublished" {{ .Format $ISO8601 | printf "content=%q" | safeHTMLAttr }}>
|
|
{{- end }}
|
|
|
|
{{- with .Lastmod }}
|
|
<meta itemprop="dateModified" {{ .Format $ISO8601 | printf "content=%q" | safeHTMLAttr }}>
|
|
{{- end }}
|
|
|
|
{{- with .WordCount }}
|
|
<meta itemprop="wordCount" content="{{ . }}">
|
|
{{- end }}
|
|
|
|
{{- $images := partial "_funcs/get-page-images" . }}
|
|
{{- range first 6 $images }}
|
|
<meta itemprop="image" content="{{ .Permalink }}">
|
|
{{- end }}
|
|
|
|
{{- /*
|
|
Keywords precedence:
|
|
|
|
1. Use "keywords" term page titles.
|
|
2. Use "keywords" from front matter if "keywords" is not a taxonomy.
|
|
3. Use "tags" term page titles.
|
|
4. Use term page titles from all taxonomies.
|
|
|
|
*/}}
|
|
{{- $keywords := slice }}
|
|
{{- range .GetTerms "keywords" }}
|
|
{{- $keywords = $keywords | append (partial "pageHelper/title.hugo" (dict "page" .Page "linkTitle" true) | plainify) }}
|
|
{{- else }}
|
|
{{- with .Keywords }}
|
|
{{- $keywords = . }}
|
|
{{- else }}
|
|
{{- range .GetTerms "tags" }}
|
|
{{- $keywords = $keywords | append (partial "pageHelper/title.hugo" (dict "page" .Page "linkTitle" true) | plainify) }}
|
|
{{- else }}
|
|
{{- range $taxonomy, $_ := site.Taxonomies }}
|
|
{{- range $.GetTerms $taxonomy }}
|
|
{{- $keywords = $keywords | append (partial "pageHelper/title.hugo" (dict "page" .Page "linkTitle" true) | plainify) }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- with $keywords }}
|
|
<meta itemprop="keywords" content="{{ delimit . `,` }}">
|
|
{{- end }} |