jefklakscodex/layouts/partials/head.html

126 lines
5.2 KiB
HTML

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
{{ with .Title }}<title>{{ . }}</title>{{ end }}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="all,follow">
<meta name="googlebot" content="index,follow,snippet,archive">
<meta name="description" content="{{ .Site.Title }} - {{ .Site.Title }}">
{{ if .Keywords }}
<meta content="{{ delimit .Keywords ", " }}" name="keywords">
{{ else if .Params.tags }}
<meta content="{{ delimit .Params.tags ", " }}" name="keywords">
{{ end }}
<!-- opengraph meta -->
<!-- see https://github.com/nozzle/hugo-snippets/blob/master/layouts/partials/head/seo/open_graph.html -->
<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">
<meta property="og:url" content="{{ .Permalink }}" />
<meta property="og:type" content="{{ if .Params.type }}{{ .Params.type }}{{ else }}website{{ end }}" />
{{ if .Params.image }}
<meta property="og:image" content="{{.Site.BaseURL}}{{ .Params.image }}" />
{{ end }}
<!-- zie sidebar.html, zelfde logica gebruikt -->
{{ $related := first 3 (where (where (where .Site.Pages.ByDate.Reverse ".Type" "==" "articles") ".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 -->
<!-- structured data -->
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "BlogPosting",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "{{ .Site.BaseURL }}"
},
"articleSection" : "{{ .Section }}",
"name" : "{{ .Title }}",
"headline" : "{{ $isHomePage := eq .Title .Site.Title }}{{ .Title }}{{ if eq $isHomePage false }} - {{ .Site.Title }}{{ end }}",
"description" : "{{ if .Description }}{{ .Description }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ end }}{{ end }}",
"inLanguage" : "{{ .Site.LanguageCode }}",
{{ if .Params.image }}
"image": "{{.Site.BaseURL}}{{ .Params.image }}",
{{ end }}
"author" : {
"@type": "Person",
"name": "{{ .Site.Author.name }}"
},
"publisher": {
"@type": "Organization",
"name": "Brain Baking",
"logo": {
"@type": "ImageObject",
"url": "https://brainbaking.com/img/avatar-icon.png",
"width": "150",
"height": "150"
}
},
"accountablePerson" : "{{ .Site.Author.name }}",
"copyrightHolder" : "{{ .Site.Author.name }}",
"copyrightYear" : "{{ .Date.Format "2006" }}",
"datePublished": "{{ .Date }}",
"dateModified" : "{{ .Lastmod }}",
"url" : "{{ .Permalink }}",
"wordCount" : "{{ .WordCount }}",
{{ if .Keywords }}
"keywords" : [ {{ range .Keywords }}"{{ . }}",{{ end }}"{{ .Title }}" ]
{{ else if .Params.tags }}
"keywords" : [ {{ if isset .Params "tags" }}{{ range .Params.tags }}"{{ . }}",{{ end }}{{ end }}"{{ .Title }}" ]
{{ else }}
"keywords": [ "{{ .Title }}" ]
{{ end }}
}
</script>
<style>
body, .content-column-content, h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
font-family: '{{ .Site.Params.font }}', sans-serif !important;
}
</style>
<link rel="stylesheet" href="{{ "css/bootstrap.min.css" | absURL }}">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family={{ .Site.Params.font }}">
<link rel="stylesheet" href="{{ "css/font-awesome.min.css" | absURL }}">
<link rel="stylesheet" href="{{ "css/owl.carousel.css" | absURL }}">
<link rel="stylesheet" href="{{ "css/owl.theme.css" | absURL }}">
<!-- Theme stylesheet, if possible do not edit this stylesheet -->
{{ with .Site.Params.style }}
<link href="{{ printf "css/style.%s.css" . | absURL }}" rel="stylesheet" id="theme-stylesheet">
{{ else }}
<link href="{{ "css/style.default.css" | absURL }}" rel="stylesheet" id="theme-stylesheet">
{{ end }}
<!-- Responsivity for older IE -->
<!-- Just in case -->
{{ `
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
` | safeHTML }}
<!-- Custom stylesheet - for your changes -->
<link href="{{ "css/custom.css" | absURL }}" rel="stylesheet">
<link rel="shortcut icon" href="{{ "img/favicon.png" | absURL }}">
{{ with .OutputFormats.Get "RSS" }}
<link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="Jefklak's Codex" />
<link href="{{ .RelPermalink }}" rel="feed" type="application/rss+xml" title="Jefklak's Codex" />
{{ end }}
{{- if (ne hugo.Environment "development") }}
{{ template "_internal/google_analytics.html" . }}
{{- end }}