mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
14d85ec136
The page images selection order as follows: 1. Page's images parameter, image resources are supported. 2. Page's image resources that naming in *feature*, *cover* or *thumbnail* pattern. 3. If no page images specified, then the first one of site's images will be used as the fallback, supports site resources.
17 lines
1.1 KiB
HTML
17 lines
1.1 KiB
HTML
<meta itemprop="name" content="{{ .Title }}">
|
|
<meta itemprop="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
|
|
|
|
{{- if .IsPage -}}
|
|
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
|
|
{{ with .PublishDate }}<meta itemprop="datePublished" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end}}
|
|
{{ with .Lastmod }}<meta itemprop="dateModified" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end}}
|
|
<meta itemprop="wordCount" content="{{ .WordCount }}">
|
|
|
|
{{- $images := partial "_funcs/get-page-images" . -}}
|
|
{{- range first 6 $images -}}
|
|
<meta itemprop="image" content="{{ .Permalink }}" />
|
|
{{- end -}}
|
|
|
|
<!-- Output all taxonomies as schema.org keywords -->
|
|
<meta itemprop="keywords" content="{{ if .IsPage}}{{ range $index, $tag := .Params.tags }}{{ $tag }},{{ end }}{{ else }}{{ range $plural, $terms := .Site.Taxonomies }}{{ range $term, $val := $terms }}{{ printf "%s," $term }}{{ end }}{{ end }}{{ end }}" />
|
|
{{- end -}}
|