mirror of
https://github.com/Wonderfall/hugo-WonderMod.git
synced 2024-11-24 19:41:37 +01:00
templates: social-meta: prefer cover image over other images
This commit is contained in:
parent
306889f68b
commit
23636ab326
@ -8,7 +8,7 @@
|
|||||||
{{- else}}
|
{{- else}}
|
||||||
<meta property="og:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" />
|
<meta property="og:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" />
|
||||||
{{- end}}
|
{{- end}}
|
||||||
{{- end }}
|
{{- else }}
|
||||||
{{ with $.Params.images }}{{ range first 6 . -}}
|
{{ with $.Params.images }}{{ range first 6 . -}}
|
||||||
<meta property="og:image" content="{{ . | absURL }}" />
|
<meta property="og:image" content="{{ . | absURL }}" />
|
||||||
{{ end }}{{ else -}}
|
{{ end }}{{ else -}}
|
||||||
@ -21,6 +21,7 @@
|
|||||||
{{- with $.Site.Params.images -}}
|
{{- with $.Site.Params.images -}}
|
||||||
<meta property="og:image" content="{{ index . 0 | absURL }}"/>
|
<meta property="og:image" content="{{ index . 0 | absURL }}"/>
|
||||||
{{ end }}{{ end }}{{ end }}
|
{{ end }}{{ end }}{{ end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
|
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
|
||||||
{{- if .IsPage }}
|
{{- if .IsPage }}
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
{{- else}}
|
{{- else}}
|
||||||
<meta itemprop="image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" />
|
<meta itemprop="image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" />
|
||||||
{{- end}}
|
{{- end}}
|
||||||
{{- end }}
|
{{- else }}
|
||||||
{{ with $.Params.images }}{{ range first 6 . -}}
|
{{ with $.Params.images }}{{ range first 6 . -}}
|
||||||
<meta itemprop="image" content="{{ . | absURL }}">
|
<meta itemprop="image" content="{{ . | absURL }}">
|
||||||
{{ end }}{{ else -}}
|
{{ end }}{{ else -}}
|
||||||
@ -24,6 +24,7 @@
|
|||||||
{{- with $.Site.Params.images -}}
|
{{- with $.Site.Params.images -}}
|
||||||
<meta itemprop="image" content="{{ index . 0 | absURL }}"/>
|
<meta itemprop="image" content="{{ index . 0 | absURL }}"/>
|
||||||
{{ end }}{{ end }}{{ end }}
|
{{ end }}{{ end }}{{ end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
<!-- Output all taxonomies as schema.org keywords -->
|
<!-- 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 }}" />
|
<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 }}" />
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
{{- else }}
|
{{- else }}
|
||||||
<meta name="twitter:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" />
|
<meta name="twitter:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" />
|
||||||
{{- end}}
|
{{- end}}
|
||||||
{{ end }}
|
{{- else }}
|
||||||
{{- with $.Params.images -}}
|
{{- with $.Params.images -}}
|
||||||
<meta name="twitter:card" content="summary_large_image"/>
|
<meta name="twitter:card" content="summary_large_image"/>
|
||||||
<meta name="twitter:image" content="{{ index . 0 | absURL }}"/>
|
<meta name="twitter:image" content="{{ index . 0 | absURL }}"/>
|
||||||
@ -25,6 +25,7 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
<meta name="twitter:title" content="{{ .Title }}"/>
|
<meta name="twitter:title" content="{{ .Title }}"/>
|
||||||
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/>
|
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/>
|
||||||
{{ with .Site.Social.twitter -}}
|
{{ with .Site.Social.twitter -}}
|
||||||
|
Loading…
Reference in New Issue
Block a user