templates: add cover image to be linked into meta
for opengraph, schema and twitter
This commit is contained in:
parent
6c4e094c91
commit
4a4d0c009c
3 changed files with 22 additions and 0 deletions
|
|
@ -2,6 +2,13 @@
|
|||
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
|
||||
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
|
||||
<meta property="og:url" content="{{ .Permalink }}" />
|
||||
{{- if .Params.cover.image -}}
|
||||
{{- if (ne .Params.cover.relative true) }}
|
||||
<meta property="og:image" content="{{ .Params.cover.image | absURL }}" />
|
||||
{{- else}}
|
||||
<meta property="og:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" />
|
||||
{{- end}}
|
||||
{{- end }}
|
||||
{{ with $.Params.images }}{{ range first 6 . -}}
|
||||
<meta property="og:image" content="{{ . | absURL }}" />
|
||||
{{ end }}{{ else -}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue