brainbaking/themes/brainbaking-minimal/layouts/partials/head-meta.html

145 lines
5.5 KiB
HTML
Raw Normal View History

2020-05-27 21:20:01 +02:00
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
2020-11-12 11:21:29 +01:00
<link rel="canonical" href="{{ .Permalink }}">
<link rel="me" title="Mastodon" href="{{ .Site.Author.mastodonlink }}" />
2021-02-28 12:48:24 +01:00
<link rel="me" title="Github" href="{{ .Site.Author.githublink }}" />
<link rel="author" href="{{ .Site.BaseURL }}humans.txt" type="text/plain" />
2021-03-08 17:16:36 +01:00
<link rel="webmention" href="https://jam.brainbaking.com/webmention" />
<link rel="pingback" href="https://jam.brainbaking.com/pingback" />
2018-07-25 09:47:59 +02:00
<!-- meta data tags, open graph -->
2020-12-14 08:57:46 +01:00
{{ $isHomePage := eq .Title .Site.Title }}
2018-07-24 21:43:40 +02:00
{{ if .Params.subtitle }}
<meta name="description" content="{{.Title}}. {{ .Params.subtitle }}. {{ .Summary | safeHTML }}">
<meta content="{{ .Title }} - {{ .Params.subtitle }}" property="og:title">
<meta content="{{ .Summary | safeHTML }}" property="og:description">
2018-07-24 21:43:40 +02:00
{{ else }}
<meta name="description" content="{{ .Title }}{{ if eq $isHomePage false }} - {{ .Site.Title }}{{ end }}">
<meta content="{{ .Title }}{{ if eq $isHomePage false }} - {{ .Site.Title }}{{ end }}" property="og:title">
<meta content="{{ .Title }}{{ if eq $isHomePage false }} - {{ .Site.Title }}{{ end }}" property="og:description">
{{ end }}{{ if .Keywords }}
<meta content="{{ delimit .Keywords ", " }}" name="keywords">
2018-07-24 21:43:40 +02:00
{{ else if .Params.tags }}
<meta content="{{ delimit .Params.tags ", " }}" name="keywords">
2018-07-24 21:43:40 +02:00
{{ end }}
<meta property="og:url" content="{{ .Permalink }}" />
<meta property="og:type" content="{{ if .Params.type }}{{ .Params.type }}{{ else }}website{{ end }}" />
{{ if .Params.bigimg }}
{{- $image := resources.Get (printf "%s%s" "bigimg/" .Params.bigimg ) -}}
{{ if eq $image nil }}
{{ else }}
{{- $imgsmall := $image.Resize "768x jpg q70" }}
{{- $imgmedium := $image.Resize "960x jpg q85" }}
<meta property="og:image" content="{{ $imgsmall.RelPermalink }}" />
<meta property="og:image:width" content="{{ $imgsmall.Width }}" />
<meta property="og:image:height" content="{{ $imgsmall.Height }}" />
<style>
.big-img {
background-image: url({{ $imgsmall.RelPermalink }}) !important;
}
@media (min-width: 768px) {
.big-img {
background-image: url({{ $imgmedium.RelPermalink }}) !important;
}
}
@media (min-width: 960px) {
.big-img {
background-image: url({{ $image.RelPermalink }}) !important;
}
}
</style>
{{ end }}
2018-07-24 21:43:40 +02:00
{{ end }}
<!-- zie sidebar.html, zelfde logica gebruikt -->
{{ $related := first 3 (where (where (where .Site.Pages.ByDate.Reverse ".Type" "==" "post") ".Params.tags" "intersect" .Params.tags) "Permalink" "!=" .Permalink) }}
{{ if $related }}
{{ range $related }}
<meta property="og:see_also" content="{{ .Permalink }}" />
{{ end }}
{{ end }}
<meta property="article:published_time" content="{{ .PublishDate }}" />
<meta property="article:modified_time" content="{{ .Date }}" />
<meta property="article:section" content="{{ .Section }}" />
{{ with .Params.tags }}{{ range first 6 . }}
<meta property="article:tag" content="{{ . }}" />
{{ end }}{{ end }}
<!-- end og -->
2018-07-25 09:47:59 +02:00
<!-- structured data -->
2020-06-09 13:45:59 +02:00
{{ $ISO8601 := "2006-01-02T15:04:05-07:00" }}
{{ $logo := "img/avatar-icon.png" }}
2018-07-25 09:47:59 +02:00
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "BlogPosting",
"mainEntityOfPage": {
"@type": "WebPage",
2020-06-09 13:45:59 +02:00
"@id": {{ .Site.BaseURL }}
2018-07-25 09:47:59 +02:00
},
"articleSection" : "{{ .Section }}",
2020-06-09 13:45:59 +02:00
"name" : {{ .Title }},
{{ if .Params.subtitle }}
2020-06-09 13:45:59 +02:00
"headline" : {{ .Params.subtitle }},
{{ else }}
2020-06-09 13:45:59 +02:00
"headline" : {{ .Title }},
{{ end }}
2020-06-09 13:45:59 +02:00
"description" : {{ if .Description }}{{ .Description }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ end }}{{ end }},
{{ if isset .Params "language" }}
"inLanguage" : "{{ .Params.language }}",
{{ else }}
"inLanguage" : "en-US",
{{ end }}
2020-06-09 12:16:37 +02:00
"isFamilyFriendly": "true",
2018-07-25 09:47:59 +02:00
{{ if .Params.bigimg }}
2020-06-09 13:45:59 +02:00
{{- $image := printf "%s%s" "bigimg/" .Params.bigimg -}}
"image": {{ $image | absURL }},
{{ else }}
2020-06-09 13:45:59 +02:00
"image": {{ $logo | absURL }},
2018-07-25 09:47:59 +02:00
{{ end }}
"author" : {
"@type": "Person",
"name": "{{ .Site.Author.name }}"
},
2020-06-09 12:16:37 +02:00
"creator" : {
"@type": "Person",
"name": "{{ .Site.Author.name }}"
},
2018-07-25 09:47:59 +02:00
"publisher": {
"@type": "Organization",
"name": "{{ .Site.Title }}",
2020-06-09 12:16:37 +02:00
"url": {{ .Site.BaseURL }},
2018-07-25 09:47:59 +02:00
"logo": {
"@type": "ImageObject",
2020-06-09 13:45:59 +02:00
"url": {{ $logo | absURL }},
2020-06-09 12:16:37 +02:00
"width":"32",
"height":"32"
2018-07-25 09:47:59 +02:00
}
},
2018-07-25 09:47:59 +02:00
"accountablePerson" : "{{ .Site.Author.name }}",
2020-06-09 12:16:37 +02:00
"copyrightHolder" : "{{ .Site.Title }}",
2018-07-25 09:47:59 +02:00
"copyrightYear" : "{{ .Date.Format "2006" }}",
2020-06-09 13:45:59 +02:00
"dateCreated": {{ .Date.Format $ISO8601 }},
"datePublished": {{ .PublishDate.Format $ISO8601 }},
"dateModified": {{ .Lastmod.Format $ISO8601 }},
"url" : {{ .Permalink }},
2018-07-25 09:47:59 +02:00
"wordCount" : "{{ .WordCount }}",
2020-11-19 10:50:03 +01:00
"keywords" : [ {{ if isset .Params "tags" }}{{ range .Params.tags }}{{ . }},{{ end }}{{ end }}{{ .Title }}, {{ .Section }} ]
2018-07-25 09:47:59 +02:00
}
</script>
2020-11-24 21:38:12 +01:00
<!-- twitter cards -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="{{ .Title }}">
<meta name="twitter:description" content="{{ if .Description }}{{ .Description }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ end }}{{ end }}">
{{ if .Params.bigimg }}
{{- $image := printf "%s%s" "bigimg/" .Params.bigimg -}}
<meta name="twitter:image" content="{{ $image | absURL }}">
{{ else }}
<meta name="twitter:image" content="{{ $logo | absURL }}">
{{ end }}
<meta name="twitter:image:alt" content="{{ .Params.subtitle }}">