templates: social-meta: prefer cover image over other images
This commit is contained in:
parent
306889f68b
commit
23636ab326
|
@ -8,7 +8,7 @@
|
|||
{{- else}}
|
||||
<meta property="og:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" />
|
||||
{{- end}}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{ with $.Params.images }}{{ range first 6 . -}}
|
||||
<meta property="og:image" content="{{ . | absURL }}" />
|
||||
{{ end }}{{ else -}}
|
||||
|
@ -21,6 +21,7 @@
|
|||
{{- with $.Site.Params.images -}}
|
||||
<meta property="og:image" content="{{ index . 0 | absURL }}"/>
|
||||
{{ end }}{{ end }}{{ end }}
|
||||
{{- end }}
|
||||
|
||||
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
|
||||
{{- if .IsPage }}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
{{- else}}
|
||||
<meta itemprop="image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" />
|
||||
{{- end}}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{ with $.Params.images }}{{ range first 6 . -}}
|
||||
<meta itemprop="image" content="{{ . | absURL }}">
|
||||
{{ end }}{{ else -}}
|
||||
|
@ -24,6 +24,7 @@
|
|||
{{- with $.Site.Params.images -}}
|
||||
<meta itemprop="image" content="{{ index . 0 | absURL }}"/>
|
||||
{{ end }}{{ end }}{{ end }}
|
||||
{{- 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 }}" />
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
{{- else }}
|
||||
<meta name="twitter:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" />
|
||||
{{- end}}
|
||||
{{ end }}
|
||||
{{- else }}
|
||||
{{- with $.Params.images -}}
|
||||
<meta name="twitter:card" content="summary_large_image"/>
|
||||
<meta name="twitter:image" content="{{ index . 0 | absURL }}"/>
|
||||
|
@ -25,6 +25,7 @@
|
|||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
<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 -}}"/>
|
||||
{{ with .Site.Social.twitter -}}
|
||||
|
|
Loading…
Reference in New Issue