95 lines
3.3 KiB
HTML
95 lines
3.3 KiB
HTML
{{- $isPost := eq .Section "post" -}}
|
|
{{- $perm := .Permalink -}}
|
|
{{- $base := .Site.BaseURL -}}
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="color-scheme" content="dark light">
|
|
<link rel="canonical" href="{{ $perm }}">
|
|
<link rel="me" title="Mastodon" href="{{ .Site.Author.mastodonlink }}" />
|
|
<link rel="me" title="Github" href="{{ .Site.Author.githublink }}" />
|
|
<link rel="author" href="{{ $base }}humans.txt" type="text/plain" />
|
|
<!-- generate a thumbnail -->
|
|
{{- $logo := "img/bblogo.png" -}}
|
|
{{- $thumb := $logo | absURL -}}
|
|
{{- $match := findRE `!\[(.*)\]\((.+).(jpg|png|gif)` .RawContent 1 -}}
|
|
{{- range $match -}}
|
|
{{- $relthumb := replaceRE `!\[(.*)\]\(` "" . -}}
|
|
{{- if hasPrefix $relthumb "/" -}}
|
|
{{- $thumb = printf "%s%s" $base $relthumb -}}
|
|
{{- else -}}
|
|
{{- $thumb = printf "%s%s" $perm $relthumb -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
<!-- determine description -->
|
|
{{- $description := printf "%s | %s" .Site.Title .Site.Params.description -}}
|
|
{{- if .Params.subtitle -}}
|
|
{{- $description = .Params.subtitle -}}
|
|
{{- else if .Summary -}}
|
|
{{- $description = .Summary | safeHTML | truncate 100 -}}
|
|
{{- end -}}
|
|
|
|
<!-- meta data tags, open graph -->
|
|
<meta property="og:site_name" content="{{ .Site.Title }}">
|
|
<meta property="og:title" content="{{ .Title }}">
|
|
<meta name="description" property="og:description" content="{{ $description }}">
|
|
<meta property="og:url" content="{{ $perm }}" />
|
|
<meta property="og:type" content="{{ if $isPost }}article{{ else }}website{{ end }}" />
|
|
<meta property="og:image" content="{{ $thumb }}" />
|
|
<meta property="article:published_time" content="{{ .PublishDate }}" />
|
|
<meta property="article:modified_time" content="{{ .Date }}" />
|
|
<meta property="article:section" content="{{ .Section }}" />
|
|
{{ with .Params.tags }}
|
|
<meta name="keywords" content="{{ delimit . ", " }}">
|
|
{{ range . }}
|
|
<meta property="article:tag" content="{{ . }}" />
|
|
{{- end -}}
|
|
{{- end -}}
|
|
<!-- end og -->
|
|
|
|
<!-- structured data -->
|
|
{{- $ISO8601 := "2006-01-02T15:04:05-07:00" -}}
|
|
<script type="application/ld+json">
|
|
{
|
|
"@context" : "https://schema.org",
|
|
"@type" : "BlogPosting",
|
|
"mainEntityOfPage": {
|
|
"@type": "WebPage",
|
|
"@id": {{ $base }}
|
|
},
|
|
"articleSection" : "{{ .Section }}",
|
|
"name" : {{ .Title }},
|
|
"description" : {{ $description }},
|
|
"inLanguage" : "en-US",
|
|
"isFamilyFriendly": "true",
|
|
"image": {{ $thumb }},
|
|
"author" : {
|
|
"@type": "Person",
|
|
"name": "{{ .Site.Author.name }}"
|
|
},
|
|
"creator" : {
|
|
"@type": "Person",
|
|
"name": "{{ .Site.Author.name }}"
|
|
},
|
|
"publisher": {
|
|
"@type": "Organization",
|
|
"name": "{{ .Site.Title }}",
|
|
"url": {{ $base }},
|
|
"logo": {
|
|
"@type": "ImageObject",
|
|
"url": {{ $logo | absURL }},
|
|
"width":"32",
|
|
"height":"32"
|
|
}
|
|
},
|
|
"accountablePerson" : "{{ .Site.Author.name }}",
|
|
"copyrightHolder" : "{{ .Site.Title }}",
|
|
"copyrightYear" : "{{ .Date.Format "2006" }}",
|
|
"dateCreated": {{ .Date.Format $ISO8601 }},
|
|
"datePublished": {{ .PublishDate.Format $ISO8601 }},
|
|
"dateModified": {{ .Lastmod.Format $ISO8601 }},
|
|
"url" : {{ $perm }},
|
|
"wordCount" : "{{ .WordCount }}",
|
|
"keywords" : [ {{ if isset .Params "tags" }}{{ range .Params.tags }}{{ . }},{{ end }}{{ end }}{{ .Title }}, {{ .Section }} ]
|
|
}
|
|
</script> |