bobatheme/layouts/partials/seo-tags/schema.html

31 lines
940 B
HTML

<meta itemprop="name" content="{{ .Title | plainify }}">
<meta itemprop="description" content="{{ (partial "seo-description.html" .) | plainify }}">
{{ $format := "2006-01-02T15:04:05-07:00" }}
{{ with .Date }}
<meta itemprop="datePublished" content="{{ .Format $format }}">
{{ end }}
{{ with .Lastmod }}
<meta itemprop="dateModified" content="{{ .Format $format }}">
{{ end }}
<meta itemprop="wordCount" content="{{ .WordCount }}">
{{ $images := $.Resources.ByType "image" }}
{{ $featured := $images.GetMatch "*feature*" }}
{{ if not $featured }}
{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}
{{ end }}
{{ with $featured }}
<meta itemprop="image" content="{{ $featured.Permalink }}">
{{ end }}
{{ with (.GetTerms "tags") }}
{{ $tags := slice }}
{{ range . }}
{{ $tags = $tags | append .LinkTitle }}
{{ end }}
<meta itemprop="keywords" content="{{ delimit $tags ", " }}">
{{ end }}