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

105 lines
3.9 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 }}">
2018-07-25 09:47:59 +02:00
<!-- meta data tags, open graph -->
2018-07-24 21:43:40 +02:00
{{ if .Params.subtitle }}
<meta name="description" content="{{ .Title }} - {{ .Params.subtitle }}">
<meta content="{{ .Title }}" property="og:title">
<meta content="{{ .Params.subtitle }}" property="og:description">
{{ else }}
<meta name="description" content="{{ $isHomePage := eq .Title .Site.Title }}{{ .Title }}{{ if eq $isHomePage false }} - {{ .Site.Title }}{{ end }}">
<meta content="{{ $isHomePage := eq .Title .Site.Title }}{{ .Title }}{{ if eq $isHomePage false }} - {{ .Site.Title }}{{ end }}" property="og:title">
<meta content="{{ $isHomePage := eq .Title .Site.Title }}{{ .Title }}{{ if eq $isHomePage false }} - {{ .Site.Title }}{{ end }}" property="og:description">
{{ end }}
{{ if .Keywords }}
<meta content="{{ delimit .Keywords ", " }}" name="keywords">
{{ else if .Params.tags }}
<meta content="{{ delimit .Params.tags ", " }}" name="keywords">
{{ end }}
<meta property="og:url" content="{{ .Permalink }}" />
<meta property="og:type" content="{{ if .Params.type }}{{ .Params.type }}{{ else }}website{{ end }}" />
{{ if .Params.bigimg }}
<meta property="og:image" content="{{.Site.BaseURL}}{{ .Params.bigimg }}" />
{{ 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-06-09 13:45:59 +02:00
"keywords" : [ {{ if isset .Params "tags" }}{{ range .Params.tags }}"{{ . }}",{{ end }}{{ end }}"{{ .Title }}", "{{ .Section }}" ]
2018-07-25 09:47:59 +02:00
}
</script>