diff options
Diffstat (limited to 'layouts/partials/social_card.html')
-rw-r--r-- | layouts/partials/social_card.html | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/layouts/partials/social_card.html b/layouts/partials/social_card.html index 520162c..61914ef 100644 --- a/layouts/partials/social_card.html +++ b/layouts/partials/social_card.html @@ -38,3 +38,14 @@ {{ $card := $bg.Filter (images.Overlay $fg 112 140 ) }} {{ $card := $card.Resize "900x webp q100" }} + +<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 }}"> +<meta itemprop="image" content="{{ $card.Permalink | absURL }}"/> +<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 -}} |