jefklakscodex/themes/jefklak-creative-portfolio/layouts/partials/head.html

131 lines
5.7 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">
{{ if .Description }}
<meta name="description" content="{{ .Description | safeHTML }}">
{{ else }}
<meta name="description" content="{{ .Summary | safeHTML }}">
{{ end }}
{{ if .Keywords }}
<meta content="{{ delimit .Keywords ", " }}, {{ .Title }}" name="keywords">
{{ else if .Params.tags }}
<meta content="{{ delimit .Params.tags ", " }}, {{ .Title }}" 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 -->
{{ $ISO8601 := "2006-01-02T15:04:05-07:00" }}
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "BlogPosting",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": {{ .Site.BaseURL }}
},
"articleSection" : "{{ .Section }}",
"name" : {{ .Title }},
"headline" : {{ .Title }},
"description" : {{ if .Description }}{{ .Description }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ end }}{{ end }},
"inLanguage" : "{{ .Site.LanguageCode }}",
{{ if .Params.image }}
"image": {{ .Params.image | absURL }},
{{ else }}
"image": "{{.Site.BaseURL}}img/logo.png",
{{ end }}
"author" : {
"@type": "Person",
"name": "{{ .Site.Author.name }}"
},
"creator" : {
"@type": "Person",
"name": "{{ .Site.Author.name }}"
},
"publisher": {
"@type": "Organization",
"name": "Brain Baking",
"url": {{ .Site.BaseURL }},
"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" }}",
"dateCreated": {{ .Date.Format $ISO8601 }},
"datePublished": {{ .PublishDate.Format $ISO8601 }},
"dateModified": {{ .Lastmod.Format $ISO8601 }},
"url" : {{ .Permalink }},
"wordCount" : "{{ .WordCount }}",
{{ if .Keywords }}
"keywords" : [ {{ range .Keywords }}{{ . }},{{ end }}{{ .Title }} ],
"genre" : [ {{ range .Keywords }}{{ . }},{{ end }}{{ .Title }} ]
{{ else if .Params.tags }}
"keywords" : [ {{ if isset .Params "tags" }}{{ range .Params.tags }}{{ . }},{{ end }}{{ end }}{{ .Title }} ],
"genre" : [ {{ if isset .Params "tags" }}{{ range .Params.tags }}{{ . }},{{ end }}{{ end }}{{ .Title }} ]
{{ else }}
"keywords": [ {{ .Title }} ]
{{ end }}
}
</script>
<link rel="stylesheet" href="{{ "css/bootstrap.min.css" | absURL }}">
<link rel="stylesheet" href="{{ "css/font-awesome.min.css" | absURL }}">
<link rel="stylesheet" href="{{ "css/simple-lightbox.min.css" | absURL }}">
<link href="{{ "css/style.default.css" | absURL }}" rel="stylesheet" id="theme-stylesheet">
{{- $options := (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" "true") -}}
{{- $styles := resources.Get "sass/main.sass" | resources.ExecuteAsTemplate "main.sass" . | resources.ToCSS $options | resources.Fingerprint "sha512" }}
<link rel = 'stylesheet' href = '{{ $styles.Permalink }}' integrity = '{{ $styles.Data.Integrity }}'>
<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") }}
<script data-goatcounter="https://stats.jefklakscodex.com/count"
async src="//stats.jefklakscodex.com/count.js"></script>
{{- end }}
<!-- 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.image }}
<meta name="twitter:image" content="{{ .Params.image | absURL }}">
{{ end }}
<meta name="twitter:image:alt" content="Figure of {{ .Title }}">