Initial commit
This commit is contained in:
9
layouts/partials/footer/footer.html
Normal file
9
layouts/partials/footer/footer.html
Normal file
@ -0,0 +1,9 @@
|
||||
<footer class="footer text-muted">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-16 text-center">
|
||||
<p>{{ .Site.Params.footer | safeHTML }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
13
layouts/partials/footer/script-footer.html
Normal file
13
layouts/partials/footer/script-footer.html
Normal file
@ -0,0 +1,13 @@
|
||||
{{ $lazysizes := resources.Get "js/vendor/lazysizes/lazysizes.min.js" -}}
|
||||
{{ if eq (hugo.Environment) "development" -}}
|
||||
{{ $alpinejs := resources.Get "js/vendor/alpinejs/alpine.js" -}}
|
||||
{{ $app := resources.Get "js/app.js" -}}
|
||||
{{ $js := slice $alpinejs $lazysizes $app | resources.Concat "main.js" -}}
|
||||
<script src="{{ $js.Permalink }}" defer></script>
|
||||
{{ else -}}
|
||||
{{ $alpinejs := resources.Get "js/vendor/alpinejs/alpine.js" | minify -}}
|
||||
{{ $app := resources.Get "js/app.js" | minify -}}
|
||||
{{ $js := slice $alpinejs $lazysizes $app | resources.Concat "main.js" -}}
|
||||
{{ $secureJS := $js | resources.Fingerprint "sha512" -}}
|
||||
<script src="{{ $secureJS.Permalink }}" integrity="{{ $secureJS.Data.Integrity }}" crossorigin="anonymous" defer></script>
|
||||
{{ end -}}
|
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" | absLangURL }}">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="{{ "favicon-32x32.png" | absLangURL }}">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ "favicon-16x16.png" | absLangURL }}">
|
||||
<link rel="manifest" href="{{ "site.webmanifest" | absLangURL }}">
|
10
layouts/partials/head/head.html
Normal file
10
layouts/partials/head/head.html
Normal file
@ -0,0 +1,10 @@
|
||||
<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">
|
||||
{{ 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>
|
6
layouts/partials/head/resource-hints.html
Normal file
6
layouts/partials/head/resource-hints.html
Normal file
@ -0,0 +1,6 @@
|
||||
<!--
|
||||
<link rel="preload" as="font" href="{{ .Site.BaseURL }}fonts/vendor/jost/Jost-400-Book.otf" type="font/otf" crossorigin>
|
||||
<link rel="preload" as="font" href="{{ .Site.BaseURL }}fonts/vendor/jost/Jost-400-BookItalic.otf" type="font/otf" crossorigin>
|
||||
<link rel="preload" as="font" href="{{ .Site.BaseURL }}fonts/vendor/jost/Jost-500-Medium.otf" type="font/otf" crossorigin>
|
||||
<link rel="preload" as="font" href="{{ .Site.BaseURL }}fonts/vendor/jost/Jost-500-MediumItalic.otf" type="font/otf" crossorigin>
|
||||
-->
|
11
layouts/partials/head/script-header.html
Normal file
11
layouts/partials/head/script-header.html
Normal file
@ -0,0 +1,11 @@
|
||||
{{ if isset .Site.Params "googleanalytics" -}}
|
||||
<script>
|
||||
(function(e,t,n,i,s,a,c){e[n]=e[n]||function(){(e[n].q=e[n].q||[]).push(arguments)}
|
||||
;a=t.createElement(i);c=t.getElementsByTagName(i)[0];a.async=true;a.src=s
|
||||
;c.parentNode.insertBefore(a,c)
|
||||
})(window,document,"galite","script","{{ .Site.BaseURL }}js/vendor/ga-lite/ga-lite.min.js");
|
||||
|
||||
galite('create', '{{ $.Site.Params.googleAnalytics }}', 'auto');
|
||||
galite('send', 'pageview');
|
||||
</script>
|
||||
{{ end -}}
|
40
layouts/partials/head/seo.html
Normal file
40
layouts/partials/head/seo.html
Normal file
@ -0,0 +1,40 @@
|
||||
{{ if and (eq .Kind "section" "taxonomy" "taxonomyTerm") (ne .Section "blog" ) -}}
|
||||
<meta name="robots" content="noindex, noarchive">
|
||||
{{ else -}}
|
||||
{{ with .Params.robots -}}
|
||||
<meta name="robots" content="{{ . }}">
|
||||
{{ else -}}
|
||||
<meta name="robots" content="index, follow">
|
||||
{{ 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 -}}
|
||||
|
||||
{{ with .Params.canonical -}}
|
||||
<link rel="canonical" href="{{ . }}">
|
||||
{{ else -}}
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
{{ end -}}
|
||||
|
||||
{{ template "_internal/twitter_cards.html" . -}}
|
||||
<meta name="twitter:site" content="{{ .Site.Params.twitterSite }}">
|
||||
<meta name="twitter:creator" content="{{ .Site.Params.twitterCreator }}">
|
||||
|
||||
{{ template "_internal/opengraph.html" . -}}
|
||||
<meta property="og:locale" content="{{ .Site.Params.ogLocale }}">
|
||||
|
||||
{{ range .AlternativeOutputFormats -}}
|
||||
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
|
||||
{{ end -}}
|
||||
|
||||
{{ block "head/structured-data" . }}{{ partial "head/structured-data.html" . }}{{ end }}
|
105
layouts/partials/head/structured-data.html
Normal file
105
layouts/partials/head/structured-data.html
Normal file
@ -0,0 +1,105 @@
|
||||
{{ if .IsHome -}}
|
||||
{{ if eq .Site.Params.schemaType "Organization" -}}
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Organization",
|
||||
"url": "{{ .Site.BaseURL }}",
|
||||
"name": "{{ .Site.Params.title }}",
|
||||
"logo": "{{ .Site.BaseURL }}{{ .Site.Params.schemaLogo }}",
|
||||
"sameAs": [
|
||||
"{{ .Site.Params.schemaTwitter | safeURL }}",
|
||||
"{{ .Site.Params.schemaLinkedIn | safeURL }}"
|
||||
]
|
||||
}
|
||||
</script>
|
||||
{{ end -}}
|
||||
{{ if eq .Site.Params.schemaType "Person" -}}
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Person",
|
||||
"url": "{{ .Site.BaseURL }}",
|
||||
"name": "{{ .Site.Params.title }}",
|
||||
"sameAs": [
|
||||
"{{ .Site.Params.schemaTwitter | safeURL }}",
|
||||
"{{ .Site.Params.schemaLinkedIn | safeURL }}"
|
||||
]
|
||||
}
|
||||
</script>
|
||||
{{ end -}}
|
||||
{{ if .Site.Params.siteLinksSearchBox -}}
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "WebSite",
|
||||
"url": "{{ .Site.BaseURL }}",
|
||||
"potentialAction": {
|
||||
"@type": "SearchAction",
|
||||
"target": "{{ .Site.BaseURL }}?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": {{ apply .Params.images "absURL" "." }},
|
||||
"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": "{{ .Site.BaseURL }}{{ .Site.Params.schemaLogo }}"
|
||||
}
|
||||
{{ end -}}
|
||||
},
|
||||
"description": "{{ .Description }}"
|
||||
}
|
||||
</script>
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ $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 "/" -}}
|
||||
{{ $.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 }},
|
||||
"item": {
|
||||
"@id": "{{ .url }}",
|
||||
"name": "{{ .name }}"
|
||||
}
|
||||
}{{ 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>
|
40
layouts/partials/header/header.html
Normal file
40
layouts/partials/header/header.html
Normal file
@ -0,0 +1,40 @@
|
||||
<!-- <div class="header-bar fixed-top"></div> -->
|
||||
<header x-data="{ open: false }" class="navbar fixed-top navbar-expand-md navbar-light">
|
||||
<div class="container">
|
||||
<a class="navbar-brand order-0 mr-auto" href="{{ .Site.BaseURL }}">{{ .Site.Params.Title }}</a>
|
||||
<button id="mode" class="btn btn-link order-1 order-md-4" type="button" aria-label="Toggle mode">
|
||||
<span class="toggle-dark"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-moon"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg></span>
|
||||
<span class="toggle-light"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-sun"><circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line></svg></span>
|
||||
</button>
|
||||
<ul class="navbar-nav social-nav order-2 order-md-5">
|
||||
{{ range .Site.Menus.social -}}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ .URL | absLangURL }}" target="_blank" rel="noreferrer noopener">{{ .Pre | safeHTML }}<span class="ml-2 sr-only">{{ .Name | safeHTML }}</span></a>
|
||||
</li>
|
||||
{{ end -}}
|
||||
</ul>
|
||||
<button @click="open = true" id="navigation" class="btn btn-link order-3 d-md-none" type="button" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<svg x-bind:class="{ 'd-none': open }" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg>
|
||||
<svg class="d-none" x-bind:class="{ 'd-block': open }" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
|
||||
</button>
|
||||
<div x-show="open" @click.away="open = false" x-bind:class="{ 'd-block': open }" class="navbar-collapse order-4 order-md-1">
|
||||
<ul class="navbar-nav main-nav mr-auto order-5 order-md-2">
|
||||
{{- $current := . -}}
|
||||
{{ range .Site.Menus.main -}}
|
||||
{{- $active := or ($current.IsMenuCurrent "main" .) ($current.HasMenuCurrent "main" .) -}}
|
||||
{{- $active = or $active (eq .Name $current.Title) -}}
|
||||
{{- $active = or $active (and (eq .Name "Docs") (eq $current.Section "docs")) -}}
|
||||
{{- $active = or $active (and (eq .Name "Guides") (eq $current.Section "guides")) -}}
|
||||
{{- $active = or $active (and (eq .Name "Blog") (eq $current.Section "blog" "authors")) -}}
|
||||
<li class="nav-item{{ if $active }} active{{ end }}">
|
||||
<a class="nav-link" href="{{ .URL | absLangURL }}">{{ .Name }}</a>
|
||||
</li>
|
||||
{{ end -}}
|
||||
</ul>
|
||||
<div class="break order-6 d-md-none"></div>
|
||||
<form class="navbar-form flex-grow-1 order-7 order-md-3">
|
||||
<input class="form-control is-search" type="search" placeholder="Search {{ .Site.Params.Title }} docs..." aria-label="Search {{ .Site.Params.Title }} docs...">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
1
layouts/partials/main/blog-meta.html
Normal file
1
layouts/partials/main/blog-meta.html
Normal file
@ -0,0 +1 @@
|
||||
<p><small>Posted {{ .Lastmod.Format "January 2, 2006" }} by {{ if .Params.authors -}}{{ range $index, $author := .Params.authors }}{{ if gt $index 0 }} and {{ end }}<a class="stretched-link position-relative" href="{{ "/authors/" | absURL }}{{ . | urlize }}/">{{ . }}</a>{{ end -}}{{ end -}} ‐ <strong>{{ .ReadingTime -}} min read</strong></small><p>
|
24
layouts/partials/main/docs-navigation.html
Normal file
24
layouts/partials/main/docs-navigation.html
Normal file
@ -0,0 +1,24 @@
|
||||
{{ if or .Prev .Next -}}
|
||||
<div class="docs-navigation d-flex justify-content-between">
|
||||
<!-- https://www.feliciano.tech/blog/custom-sort-hugo-single-pages/ -->
|
||||
{{ $pages := where site.RegularPages "Section" .Section -}}
|
||||
{{ with $pages.Next . -}}
|
||||
<a href="{{ .Permalink }}">
|
||||
<div class="card my-3">
|
||||
<div class="card-body py-2">
|
||||
← {{ .Title }}
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{{ end -}}
|
||||
{{ with $pages.Prev . -}}
|
||||
<a class="ml-auto" href="{{ .Permalink }}">
|
||||
<div class="card my-3">
|
||||
<div class="card-body py-2">
|
||||
{{ .Title }} →
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{{ end -}}
|
||||
</div>
|
||||
{{ end -}}
|
1
layouts/partials/main/headline-hash.html
Normal file
1
layouts/partials/main/headline-hash.html
Normal file
@ -0,0 +1 @@
|
||||
{{ . | replaceRE "(<h[2-9] id=\"([^\"]+)\".+)(</h[2-9]+>)" `${1}<a href="#${2}" class="anchor">#</a> ${3}` | safeHTML }}
|
13
layouts/partials/sidebar/docs-menu.html
Normal file
13
layouts/partials/sidebar/docs-menu.html
Normal file
@ -0,0 +1,13 @@
|
||||
{{ $currentPage := . -}}
|
||||
{{ range .Site.Menus.docs -}}
|
||||
<h3>{{ .Name }}</h3>
|
||||
{{ if .HasChildren -}}
|
||||
<ul class="list-unstyled">
|
||||
{{ range .Children -}}
|
||||
{{- $active := or ($currentPage.IsMenuCurrent "docs" .) ($currentPage.HasMenuCurrent "docs" .) -}}
|
||||
{{- $active = or $active (eq .Name $currentPage.Title) -}}
|
||||
<li><a class="docs-link{{ if $active }} active{{ end }}" href="{{ .URL }}">{{ .Name }}</a></li>
|
||||
{{ end -}}
|
||||
</ul>
|
||||
{{ end -}}
|
||||
{{ end -}}
|
6
layouts/partials/sidebar/docs-toc.html
Normal file
6
layouts/partials/sidebar/docs-toc.html
Normal file
@ -0,0 +1,6 @@
|
||||
{{ if ne .Params.toc false -}}
|
||||
<div class="page-links">
|
||||
<h3>On this page</h3>
|
||||
{{ .TableOfContents }}
|
||||
</div>
|
||||
{{ end -}}
|
Reference in New Issue
Block a user