GoBlog/templates/postheadmeta.gohtml

27 lines
1.1 KiB
Plaintext
Raw Normal View History

2020-11-01 17:37:21 +00:00
{{ define "postheadmeta" }}
2020-11-09 16:04:20 +00:00
{{ with .Canonical }}
<meta property="og:url" content="{{ . }}">
<meta property="twitter:url" content="{{ . }}">
{{ end }}
2021-08-05 06:09:34 +00:00
{{ with .Data.RenderedTitle }}
<meta property="og:title" content="{{ . }}">
<meta property="twitter:title" content="{{ . }}">
2020-11-09 16:04:20 +00:00
{{ end }}
{{ with summary .Data }}
<meta name="description" content="{{ . }}">
<meta property="og:description" content="{{ . }}">
<meta property="twitter:description" content="{{ . }}">
{{ end }}
2020-11-01 17:37:21 +00:00
{{ $ISO8601 := "2006-01-02T15:04:05-07:00" }}
2020-11-09 16:04:20 +00:00
{{ with .Data.Published }}
<meta itemprop="datePublished" content="{{ dateformat . $ISO8601 }}">
2020-11-01 17:37:21 +00:00
{{ end }}
2020-11-09 16:04:20 +00:00
{{ with .Data.Updated }}
<meta itemprop="dateModified" content="{{ dateformat . $ISO8601 }}">
2020-11-01 17:37:21 +00:00
{{ end }}
{{ range $key, $image := photolinks .Data }}
2020-11-01 17:37:21 +00:00
<meta itemprop="image" content="{{ $image }}">
2020-11-09 16:04:20 +00:00
<meta property="og:image" content="{{ $image }}">
<meta property="twitter:image" content="{{ $image }}">
2020-11-01 17:37:21 +00:00
{{ end }}
{{ end }}