bobatheme/layouts/partials/schema.html

27 lines
934 B
HTML
Raw Normal View History

<meta itemprop="name" content="{{ .Title | plainify }}">
2021-11-20 18:24:56 -06:00
<meta itemprop="description" content="{{ with .Description }}{{ . }}{{ else }}{{ if .IsPage }}{{ .Summary | plainify }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
{{ $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 }}">
2021-11-20 18:24:56 -06:00
{{ $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 }}
2021-11-20 18:24:56 -06:00
{{ with .Params.tags }}
<meta itemprop="keywords" content="{{ delimit . ", " }}">
{{ end }}