bobatheme/layouts/partials/schema.html

27 lines
923 B
HTML

<meta itemprop="name" content="{{ .Title }}">
<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 }}">
{{ $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 .Params.tags }}
<meta itemprop="keywords" content="{{ delimit . ", " }}">
{{ end }}