21 lines
1.3 KiB
HTML
21 lines
1.3 KiB
HTML
<meta property="og:title" content="{{ if .IsHome }}{{ with .Site.Params.title }}{{ . }}{{ end }}{{ else }}{{ .Title }}{{ end }}" />
|
|
<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 }}" />
|
|
|
|
{{- $images := $.Resources.ByType "image" -}}
|
|
{{ $featured := ($images.GetMatch (.Params.featured_image | default "*feature*")) | default (index $images 0) }}
|
|
{{- with $featured -}}
|
|
<meta property="og:image" content="{{ $featured.Permalink }}" />
|
|
{{- end -}}
|
|
|
|
{{- if .IsPage }}
|
|
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
|
|
<meta property="article:section" content="{{ .Section }}" />
|
|
{{ with .PublishDate }}<meta property="article:published_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
|
|
{{ with .Lastmod }}<meta property="article:modified_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
|
|
{{- end -}}
|
|
|
|
{{- with .Params.locale }}<meta property="og:locale" content="{{ . }}" />{{ end }}
|
|
{{- with .Site.Params.title }}<meta property="og:site_name" content="{{ . }}" />{{ end }}
|