Switch theme to Doks
This commit is contained in:
5
layouts/partials/head/favicons.html
Normal file
5
layouts/partials/head/favicons.html
Normal file
@@ -0,0 +1,5 @@
|
||||
<meta name="theme-color" content="{{ $.Site.Params.themeColor }}">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="{{ "apple-touch-icon.png" | absURL }}">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="{{ "favicon-32x32.png" | absURL }}">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ "favicon-16x16.png" | absURL }}">
|
||||
<link rel="manifest" href="{{ "site.webmanifest" | absURL }}">
|
||||
11
layouts/partials/head/head.html
Normal file
11
layouts/partials/head/head.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<script src="https://code.iconify.design/1/1.0.7/iconify.min.js"></script>
|
||||
{{ block "head/resource-hints" . }}{{ partial "head/resource-hints.html" . }}{{ end }}
|
||||
{{ block "head/stylesheet" . }}{{ partial "head/stylesheet.html" . }}{{ end }}
|
||||
{{ block "head/seo" . }}{{ partial "head/seo.html" . }}{{ end }}
|
||||
{{ block "head/favicons" . }}{{ partial "head/favicons.html" . }}{{ end }}
|
||||
{{ block "head/script-header" . }}{{ partial "head/script-header.html" . }}{{ end }}
|
||||
</head>
|
||||
93
layouts/partials/head/opengraph.html
Normal file
93
layouts/partials/head/opengraph.html
Normal file
@@ -0,0 +1,93 @@
|
||||
<meta property="og:title" content="{{ .Title }}">
|
||||
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
|
||||
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}">
|
||||
{{ if $.Scratch.Get "paginator" -}}
|
||||
{{ $paginator := .Paginate (where .Site.RegularPages.ByDate.Reverse "Section" "blog" ) -}}
|
||||
<meta property="og:url" content="{{ .Paginator.URL | absURL }}">
|
||||
{{ else -}}
|
||||
<meta property="og:url" content="{{ .Permalink }}">
|
||||
{{ end -}}
|
||||
|
||||
{{ with $.Params.images -}}
|
||||
{{ range first 6 . -}}
|
||||
<meta property="og:image" content="{{ $.Permalink }}{{ . }}">
|
||||
{{ end -}}
|
||||
{{ else -}}
|
||||
{{ $images := $.Resources.ByType "image" -}}
|
||||
{{ $featured := $images.GetMatch "*feature*" -}}
|
||||
{{ if not $featured -}}
|
||||
{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}
|
||||
{{ end -}}
|
||||
{{ with $featured -}}
|
||||
<meta property="og:image" content="{{ $featured.Permalink }}"/>
|
||||
{{ else -}}
|
||||
{{ with $.Site.Params.images -}}
|
||||
<meta property="og:image" content="{{ index . 0 | absURL }}"/>
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ $iso8601 := "2006-01-02T15:04:05-07:00" -}}
|
||||
{{ if .IsPage -}}
|
||||
{{ if not .PublishDate.IsZero -}}
|
||||
<meta property="article:published_time" {{ .PublishDate.Format $iso8601 | printf "content=%q" | safeHTMLAttr }}>
|
||||
{{ else if not .Date.IsZero -}}
|
||||
<meta property="article:published_time" {{ .Date.Format $iso8601 | printf "content=%q" | safeHTMLAttr }}>
|
||||
{{ end -}}
|
||||
{{ if not .Lastmod.IsZero -}}
|
||||
<meta property="article:modified_time" {{ .Lastmod.Format $iso8601 | printf "content=%q" | safeHTMLAttr }}>
|
||||
{{ end -}}
|
||||
{{ else -}}
|
||||
{{ if not .Date.IsZero -}}
|
||||
<meta property="og:updated_time" {{ .Lastmod.Format $iso8601 | printf "content=%q" | safeHTMLAttr }}>
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ with .Params.audio -}}
|
||||
<meta property="og:audio" content="{{ . }}">
|
||||
{{ end -}}
|
||||
{{ with .Params.locale -}}
|
||||
<meta property="og:locale" content="{{ . }}">
|
||||
{{ end -}}
|
||||
{{ with .Site.Params.title -}}
|
||||
<meta property="og:site_name" content="{{ . }}">
|
||||
{{ end -}}
|
||||
{{ with .Params.videos -}}
|
||||
{{ range . -}}
|
||||
<meta property="og:video" content="{{ . | absURL }}">
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ $permalink := .Permalink -}}
|
||||
{{ $siteSeries := .Site.Taxonomies.series -}}
|
||||
{{ with .Params.series -}}
|
||||
{{ range $name := . -}}
|
||||
{{ $series := index $siteSeries $name -}}
|
||||
{{ range $page := first 6 $series.Pages -}}
|
||||
{{ if ne $page.Permalink $permalink -}}
|
||||
<meta property="og:see_also" content="{{ $page.Permalink }}">
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ if .IsPage -}}
|
||||
{{ range .Site.Authors -}}
|
||||
{{ with .Social.facebook -}}
|
||||
<meta property="article:author" content="https://www.facebook.com/{{ . }}">
|
||||
{{ end -}}
|
||||
{{ with .Site.Social.facebook -}}
|
||||
<meta property="article:publisher" content="https://www.facebook.com/{{ . }}">
|
||||
{{ end -}}
|
||||
<meta property="article:section" content="{{ .Section }}">
|
||||
{{ with .Params.tags -}}
|
||||
{{ range first 6 . -}}
|
||||
<meta property="article:tag" content="{{ . }}">
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ with .Site.Social.facebook_admin -}}
|
||||
<meta property="fb:admins" content="{{ . }}">
|
||||
{{ end -}}
|
||||
2
layouts/partials/head/resource-hints.html
Normal file
2
layouts/partials/head/resource-hints.html
Normal file
@@ -0,0 +1,2 @@
|
||||
<link rel="preload" as="font" href="{{ "fonts/vendor/jost/jost-v4-latin-regular.woff2" | absURL }}" type="font/woff2" crossorigin>
|
||||
<link rel="preload" as="font" href="{{ "fonts/vendor/jost/jost-v4-latin-700.woff2" | absURL }}" type="font/woff2" crossorigin>
|
||||
0
layouts/partials/head/script-header.html
Normal file
0
layouts/partials/head/script-header.html
Normal file
50
layouts/partials/head/seo.html
Normal file
50
layouts/partials/head/seo.html
Normal file
@@ -0,0 +1,50 @@
|
||||
{{ if eq .Kind "404" -}}
|
||||
<meta name="robots" content="noindex, follow">
|
||||
{{ else -}}
|
||||
{{ with .Params.robots -}}
|
||||
<meta name="robots" content="{{ . }}">
|
||||
{{ else -}}
|
||||
<meta name="robots" content="index, follow">
|
||||
<meta name="googlebot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1">
|
||||
<meta name="bingbot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1">
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ if .IsHome -}}
|
||||
<title>{{ .Site.Params.title }} {{ .Site.Params.titleSeparator }} {{ .Site.Params.titleAddition }}</title>
|
||||
{{ else -}}
|
||||
<title>{{ .Title }} {{ .Site.Params.titleSeparator }} {{ .Site.Params.title }}</title>
|
||||
{{ end -}}
|
||||
|
||||
{{ with .Description -}}
|
||||
<meta name="description" content="{{ . }}">
|
||||
{{ else -}}
|
||||
<meta name="description" content="{{ .Site.Params.description }}">
|
||||
{{ end -}}
|
||||
|
||||
{{ if $.Scratch.Get "paginator" }}
|
||||
<link rel="canonical" href="{{ .Paginator.URL | absURL }}">
|
||||
{{ if .Paginator.HasPrev -}}
|
||||
<link rel="prev" href="{{ .Paginator.Prev.URL | absURL }}">
|
||||
{{ end -}}
|
||||
{{ if .Paginator.HasNext -}}
|
||||
<link rel="next" href="{{ .Paginator.Next.URL | absURL }}">
|
||||
{{ end -}}
|
||||
{{ else -}}
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
{{ end -}}
|
||||
|
||||
{{ partial "head/twitter_cards.html" . }}
|
||||
<meta name="twitter:site" content="@{{ .Site.Params.twitterSite }}">
|
||||
<meta name="twitter:creator" content="@{{ .Site.Params.twitterCreator }}">
|
||||
|
||||
{{ partial "head/opengraph.html" . }}
|
||||
<meta property="article:publisher" content="https://www.facebook.com/{{ .Site.Params.facebookPublisher }}">
|
||||
<meta property="article:author" content="https://www.facebook.com/{{ .Site.Params.facebookAuthor }}">
|
||||
<meta property="og:locale" content="{{ .Site.Params.ogLocale }}">
|
||||
|
||||
{{ range .AlternativeOutputFormats -}}
|
||||
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
|
||||
{{ end -}}
|
||||
|
||||
{{ partial "head/structured-data.html" . }}
|
||||
109
layouts/partials/head/structured-data.html
Normal file
109
layouts/partials/head/structured-data.html
Normal file
@@ -0,0 +1,109 @@
|
||||
{{ if .IsHome -}}
|
||||
{{ if eq .Site.Params.schemaType "Organization" -}}
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Organization",
|
||||
"url": "{{ "/" | absURL }}",
|
||||
"name": "{{ .Site.Params.title }}",
|
||||
"logo": "{{ "/" | absURL }}{{ .Site.Params.schemaLogo }}",
|
||||
"sameAs": [
|
||||
"{{ .Site.Params.schemaTwitter | safeURL }}",
|
||||
"{{ .Site.Params.schemaLinkedIn | safeURL }}",
|
||||
"{{ .Site.Params.schemaGitHub | safeURL }}"
|
||||
]
|
||||
}
|
||||
</script>
|
||||
{{ end -}}
|
||||
{{ if eq .Site.Params.schemaType "Person" -}}
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Person",
|
||||
"url": "{{ "/" | absURL }}",
|
||||
"name": "{{ .Site.Params.title }}",
|
||||
"sameAs": [
|
||||
"{{ .Site.Params.schemaTwitter | safeURL }}",
|
||||
"{{ .Site.Params.schemaLinkedIn | safeURL }}",
|
||||
"{{ .Site.Params.schemaGitHub | safeURL }}"
|
||||
]
|
||||
}
|
||||
</script>
|
||||
{{ end -}}
|
||||
{{ if .Site.Params.siteLinksSearchBox -}}
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "WebSite",
|
||||
"url": "{{ "/" | absURL }}",
|
||||
"potentialAction": {
|
||||
"@type": "SearchAction",
|
||||
"target": "{{ "/" | absURL }}?q={search_term_string}",
|
||||
"query-input": "required name=search_term_string"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ if .IsPage -}}
|
||||
{{ if eq .Section .Site.Params.schemaSection -}}
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Article",
|
||||
"mainEntityOfPage": {
|
||||
"@type": "WebPage",
|
||||
"@id": "{{ .Permalink }}"
|
||||
},
|
||||
"headline": "{{ .Title }}",
|
||||
"image": [{{ range $i, $e := .Params.images }}{{ if $i }}, {{ end }}{{ printf "%s%s" $.Permalink $e }}{{ end }}],
|
||||
"datePublished": "{{ .PublishDate.Format "2006-01-02T15:04:05CET" }}",
|
||||
"dateModified": "{{ .Lastmod.Format "2006-01-02T15:04:05CET" }}",
|
||||
"author": {
|
||||
"@type": "{{ .Site.Params.schemaType }}",
|
||||
"name": "{{ .Site.Params.title }}"
|
||||
},
|
||||
"publisher": {
|
||||
"@type": "{{ .Site.Params.schemaType }}",
|
||||
"name": "{{ .Site.Params.title }}",
|
||||
{{ if eq .Site.Params.schemaType "Organization" -}}
|
||||
"logo": {
|
||||
"@type": "ImageObject",
|
||||
"url": "{{ "/" | absURL }}{{ .Site.Params.schemaLogo }}"
|
||||
}
|
||||
{{ end -}}
|
||||
},
|
||||
"description": "{{ .Description }}"
|
||||
}
|
||||
</script>
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ $dot := . -}}
|
||||
{{ $dot.Scratch.Set "path" "" -}}
|
||||
{{ $dot.Scratch.Set "breadcrumb" slice -}}
|
||||
|
||||
{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" -}}
|
||||
{{ $.Scratch.Add "path" .Site.BaseURL -}}
|
||||
|
||||
{{ $.Scratch.Add "breadcrumb" (slice (dict "url" .Site.BaseURL "name" "home" "position" 1 )) -}}
|
||||
{{ range $index, $element := split $url "/" -}}
|
||||
{{ $dot.Scratch.Add "path" $element -}}
|
||||
{{ $.Scratch.Add "path" "/" -}}
|
||||
{{ if ne $element "" -}}
|
||||
{{ $.Scratch.Add "breadcrumb" (slice (dict "url" ($.Scratch.Get "path") "name" . "position" (add $index 2))) -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "http://schema.org",
|
||||
"@type": "BreadcrumbList",
|
||||
"itemListElement": [{{ range $.Scratch.Get "breadcrumb" }}{{ if ne .position 1 }},{{ end }}{
|
||||
"@type": "ListItem",
|
||||
"position": {{ .position }},
|
||||
"name": "{{ .name | humanize | title }}",
|
||||
"item": "{{ .url }}"
|
||||
}{{ end }}]
|
||||
}
|
||||
</script>
|
||||
11
layouts/partials/head/stylesheet.html
Normal file
11
layouts/partials/head/stylesheet.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{{ if eq (hugo.Environment) "development" -}}
|
||||
{{ $options := (dict "targetPath" "main.css" "enableSourceMap" true "includePaths" (slice "node_modules")) -}}
|
||||
{{ $css := resources.Get "scss/app.scss" | toCSS $options -}}
|
||||
<link rel="stylesheet" href="{{ $css.Permalink }}">
|
||||
{{ else -}}
|
||||
{{ $options := (dict "targetPath" "main.css" "outputStyle" "compressed" "includePaths" (slice "node_modules")) -}}
|
||||
{{ $css := resources.Get "scss/app.scss" | toCSS $options | postCSS (dict "config" "config/postcss.config.js") -}}
|
||||
{{ $secureCSS := $css | resources.Fingerprint "sha512" -}}
|
||||
<link rel="stylesheet" href="{{ $secureCSS.Permalink }}" integrity="{{ $secureCSS.Data.Integrity }}" crossorigin="anonymous">
|
||||
{{ end -}}
|
||||
<noscript><style>img.lazyload { display: none; }</style></noscript>
|
||||
33
layouts/partials/head/twitter_cards.html
Normal file
33
layouts/partials/head/twitter_cards.html
Normal file
@@ -0,0 +1,33 @@
|
||||
{{ with $.Params.images -}}
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:image" content="{{ $.Permalink }}{{ index . 0 }}">
|
||||
{{ else -}}
|
||||
{{ $images := $.Resources.ByType "image" -}}
|
||||
{{ $featured := $images.GetMatch "*feature*" -}}
|
||||
{{ if not $featured -}}
|
||||
{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" -}}
|
||||
{{ end -}}
|
||||
{{ with $featured -}}
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:image" content="{{ $featured.Permalink }}">
|
||||
{{ else -}}
|
||||
{{ with $.Site.Params.images -}}
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:image" content="{{ index . 0 | absURL }}">
|
||||
{{ else -}}
|
||||
<meta name="twitter:card" content="summary">
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
<meta name="twitter:title" content="{{ .Title }}">
|
||||
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
|
||||
{{ with .Site.Social.twitter -}}
|
||||
<meta name="twitter:site" content="@{{ . }}">
|
||||
{{ end -}}
|
||||
|
||||
{{ range .Site.Authors -}}
|
||||
{{ with .twitter -}}
|
||||
<meta name="twitter:creator" content="@{{ . }}">
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
Reference in New Issue
Block a user