GoBlog/templates/postheadmeta.gohtml

13 lines
552 B
Plaintext

{{ define "postheadmeta" }}
<meta name="description" content="{{ with summary .Data }}{{ . }}{{ end }}">
{{ $ISO8601 := "2006-01-02T15:04:05-07:00" }}
{{ if .Data.Published }}
<meta itemprop="datePublished" content="{{ dateformat .Data.Published $ISO8601 }}">
{{ end }}
{{ if .Data.Updated }}
<meta itemprop="dateModified" content="{{ dateformat .Data.Updated $ISO8601 }}">
{{ end }}
{{ range $key, $image := ps .Data "images" }}
<meta itemprop="image" content="{{ $image }}">
{{ end }}
{{ end }}