Initial commit

This commit is contained in:
Henk Verlinde
2020-04-15 15:48:16 +02:00
commit 67f0a6e623
109 changed files with 8637 additions and 0 deletions

10
layouts/404.html Normal file
View File

@ -0,0 +1,10 @@
{{ define "main" }}
<div class="row justify-content-center">
<div class="col-md-12 col-lg-10 col-xl-8">
<article>
<h1 class="text-center">Page not found</h1>
<p class="text-center">The page you requested could not be found.</p>
</article>
</div>
</div>
{{ end }}

View File

@ -0,0 +1 @@
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noreferrer noopener"{{ end }}>{{ .Text | safeHTML }}</a>

View File

@ -0,0 +1,27 @@
<!doctype html>
<html lang="{{ .Site.LanguageCode | default "en" }}">
{{ block "head" . }}{{ partial "head/head.html" . }}{{ end }}
{{ if eq .Kind "home" -}}
{{ .Scratch.Set "class" "home" -}}
{{ else if eq .Kind "404" -}}
{{ .Scratch.Set "class" "error404" -}}
{{ else if eq .Kind "page" -}}
{{ .Scratch.Set "class" .Type -}}
{{ .Scratch.Add "class" " single" -}}
{{ else -}}
{{ .Scratch.Set "class" .Type -}}
{{ .Scratch.Add "class" " list" -}}
{{ end -}}
<body class="{{ .Scratch.Get "class" }}">
{{ block "header" . }}{{ partial "header/header.html" . }}{{ end }}
<div class="wrap container" role="document">
<div class="content">
{{ block "main" . }}{{ end }}
</div>
</div>
{{ if ne .Section "docs" }}
{{ block "footer" . }}{{ partial "footer/footer.html" . }}{{ end }}
{{ end }}
{{ block "script-footer" . }}{{ partial "footer/script-footer.html" . }}{{ end }}
</body>
</html>

View File

@ -0,0 +1,13 @@
{{ define "main" }}
<div class="row justify-content-center">
<div class="col-md-12 col-lg-10 col-xl-8">
{{ range .Paginator.Pages }}
<article>
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
{{ .Description }}
</article>
{{ end }}
{{ template "_internal/pagination.html" . }}
</div>
</div>
{{ end }}

View File

@ -0,0 +1,10 @@
{{ define "main" }}
<div class="row justify-content-center">
<div class="col-md-12 col-lg-10 col-xl-8">
<article>
<h1>{{ .Title }}</h1>
{{ .Content }}
</article>
</div>
</div>
{{ end }}

23
layouts/authors/list.html Normal file
View File

@ -0,0 +1,23 @@
{{ define "main" }}
<div class="row justify-content-center">
<div class="col-md-12 col-lg-10 col-xl-8">
<article>
<h1 class="text-center">{{ .Title }}</h1>
<div class="text-center">{{ .Content }}</div>
<div class="card-list">
{{ range .Data.Pages -}}
<div class="card">
<div class="card-body">
<h2 class="h3"><a class="stretched-link" href="{{ .Permalink }}">{{ .Params.title }}</a></h2>
{{ if eq .Section "blog" -}}
<p>{{ .Params.lead }}</p>
{{ partial "main/blog-meta.html" . -}}
{{ end -}}
</div>
</div>
{{ end -}}
</div>
</article>
</div>
</div>
{{ end }}

21
layouts/blog/list.html Normal file
View File

@ -0,0 +1,21 @@
{{ define "main" }}
<div class="row justify-content-center">
<div class="col-md-12 col-lg-10 col-xl-8">
<article>
<h1 class="text-center">{{ .Title }}</h1>
<div class="text-center">{{ .Content }}</div>
<div class="card-list">
{{ range .Data.Pages -}}
<div class="card">
<div class="card-body">
<h2 class="h3"><a class="stretched-link" href="{{ .Permalink }}">{{ .Params.title }}</a></h2>
<p>{{ .Params.lead }}</p>
{{ partial "main/blog-meta.html" . -}}
</div>
</div>
{{ end -}}
</div>
</article>
</div>
</div>
{{ end }}

14
layouts/blog/single.html Normal file
View File

@ -0,0 +1,14 @@
{{ define "main" }}
<div class="row justify-content-center">
<div class="col-md-12 col-lg-10 col-xl-8">
<article>
<div class="blog-header">
<h1>{{ .Title }}</h1>
{{ partial "main/blog-meta.html" . }}
</div>
<p class="lead">{{ .Params.lead }}</p>
{{ .Content }}
</article>
</div>
</div>
{{ end }}

22
layouts/docs/list.html Normal file
View File

@ -0,0 +1,22 @@
{{ define "main" }}
<div class="row justify-content-center">
<div class="col-md-12 col-lg-10 col-xl-8">
<article>
<h1 class="text-center">{{ .Title }}</h1>
<div class="text-center">{{ .Content }}</div>
<div class="card-list">
{{ $currentSection := .CurrentSection }}
{{ range where .Site.RegularPages.ByTitle "Section" .Section }}
{{ if in (.Permalink | string) $currentSection.RelPermalink }}
<div class="card my-3">
<div class="card-body">
<a class="stretched-link" href="{{ .Permalink }}">{{ .Params.title | title }} &rarr;</a>
</div>
</div>
{{ end }}
{{ end }}
</div>
</article>
</div>
</div>
{{ end }}

18
layouts/docs/single.html Normal file
View File

@ -0,0 +1,18 @@
{{ define "main" }}
<div class="row flex-xl-nowrap">
<div class="col-lg-5 col-xl-4 docs-sidebar">
<nav class="docs-links" aria-label="Main navigation">
{{ partial "sidebar/docs-menu.html" . }}
</nav>
</div>
<nav class="docs-toc d-none d-xl-block col-xl-3" aria-label="Secondary navigation">
{{ partial "sidebar/docs-toc.html" . }}
</nav>
<main class="docs-content col-lg-11 col-xl-9" role="main">
<h1>{{ .Title }}</h1>
<p class="lead">{{ .Params.lead | safeHTML }}</p>
{{ partial "main/headline-hash.html" .Content }}
{{ partial "main/docs-navigation.html" . }}
</main>
</div>
{{ end }}

9
layouts/index.headers Normal file
View File

@ -0,0 +1,9 @@
/*
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Content-Security-Policy: default-src 'self'; img-src 'self' data:; object-src 'none'
X-Frame-Options: SAMEORIGIN
Referrer-Policy: strict-origin
Feature-Policy: geolocation 'self'
Cache-Control: public, max-age=31536000

15
layouts/index.html Normal file
View File

@ -0,0 +1,15 @@
{{ define "main" }}
<section class="section container-fluid">
<div class="row justify-content-center">
<div class="col-lg-11 text-center">
<h1 class="mt-0">{{ .Title }}</h1>
<p class="lead">{{ .Params.Lead | safeHTML }}</p>
<a class="btn btn-primary btn-lg px-4 mb-2" href="{{ .Site.BaseURL }}docs/prologue/introduction/" role="button">Get started</a>
<p><a class="text-muted" href="https://github.com/h-enk" target="_blank" rel="noreferrer noopener"><small>{{ .Site.Params.version }}</small></a></p>
</div>
</div>
</section>
<section class="section container-fluid border-top">
{{- .Content -}}
</section>
{{ end }}

6
layouts/index.redirects Normal file
View File

@ -0,0 +1,6 @@
# redirects for Netlify - https://www.netlify.com/docs/redirects/
{{- range $p := .Site.Pages -}}
{{- range .Aliases }}
{{ . }} {{ $p.RelPermalink -}}
{{- end }}
{{- end -}}

View 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>

View 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 -}}

View 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 }}">

View 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>

View 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>
-->

View 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 -}}

View 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 }}

View 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>

View 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>

View 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>

View 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 -}}&nbsp;&hyphen;&nbsp;<strong>{{ .ReadingTime -}}&nbsp;min read</strong></small><p>

View 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">
&larr; {{ .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 }} &rarr;
</div>
</div>
</a>
{{ end -}}
</div>
{{ end -}}

View File

@ -0,0 +1 @@
{{ . | replaceRE "(<h[2-9] id=\"([^\"]+)\".+)(</h[2-9]+>)" `${1}<a href="#${2}" class="anchor">#</a> ${3}` | safeHTML }}

View 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 -}}

View File

@ -0,0 +1,6 @@
{{ if ne .Params.toc false -}}
<div class="page-links">
<h3>On this page</h3>
{{ .TableOfContents }}
</div>
{{ end -}}

7
layouts/robots.txt Normal file
View File

@ -0,0 +1,7 @@
User-agent: *
{{ if eq (hugo.Environment) "production" -}}
Allow: /
{{ else -}}
Disallow: /
{{ end }}
Sitemap: {{ "sitemap.xml" | absLangURL -}}

27
layouts/rss.xml Normal file
View File

@ -0,0 +1,27 @@
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{ with .OutputFormats.Get "RSS" }}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{ end }}
{{ range .Pages }}{{ if ne .Params.feed_exclude true }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>{{ .Summary | html }}</description>
</item>
{{ end }}{{ end }}
</channel>
</rss>

View File

@ -0,0 +1,23 @@
{{ $image := .Page.Resources.GetMatch (printf "*%s*" (.Get "src")) -}}
{{ $lqip := $image.Resize $.Site.Params.lqipWidth -}}
{{ $imgSrc := "" -}}
{{ $imgSrcSet := slice -}}
{{ $widths := $.Site.Params.landscapePhotoWidths -}}
{{ if gt $image.Height $image.Width -}}
{{ $widths = $.Site.Params.portraitPhotoWidths -}}
{{ end -}}
{{ range $widths -}}
{{ $srcUrl := (printf "%dx" . | $image.Resize).Permalink -}}
{{ if eq $imgSrc "" -}}{{ $imgSrc = $srcUrl -}}{{ end -}}
{{ $imgSrcSet = $imgSrcSet | append (printf "%s %dw" $srcUrl .) -}}
{{ end -}}
{{ $imgSrcSet = (delimit $imgSrcSet ",") -}}
<figure{{ with .Get "class" }} class="{{.}}"{{ end }}>
<img class="figure-img img-fluid lazyload blur-up" data-sizes="auto" src="{{ $lqip.Permalink }}" data-srcset="{{ $imgSrcSet }}" width="{{ $image.Width }}" height="{{ $image.Height }}" {{ with .Get "alt" }}alt="{{.}}"{{ end }}>
<noscript><img class="figure-img img-fluid" sizes="100vw" srcset="{{ $imgSrcSet }}" src="{{ $image.Permalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}" {{ with .Get "alt" }}alt="{{.}}"{{ end }}></noscript>
{{ with .Get "caption" }}<figcaption class="figure-caption">{{ . | safeHTML }}</figcaption>{{ end }}
</figure>

22
layouts/sitemap.xml Normal file
View File

@ -0,0 +1,22 @@
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
{{ range .Data.Pages }}{{ if ne .Params.sitemap_exclude true }}
<url>
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
<xhtml:link
rel="alternate"
hreflang="{{ .Lang }}"
href="{{ .Permalink }}"
/>{{ end }}
<xhtml:link
rel="alternate"
hreflang="{{ .Lang }}"
href="{{ .Permalink }}"
/>{{ end }}
</url>
{{ end }}{{ end }}
</urlset>