Merge branch 'master' of github.com:h-enk/doks

This commit is contained in:
Henk Verlinde 2021-03-10 16:16:34 +01:00
commit 4b78b2c9f0
23 changed files with 153 additions and 68 deletions

2
assets/js/bootstrap.js vendored Normal file
View File

@ -0,0 +1,2 @@
import 'bootstrap/dist/js/bootstrap.bundle.min.js'
// import 'bootstrap/dist/js/bootstrap.min.js'

View File

@ -19,6 +19,7 @@
@import "components/forms";
@import "components/images";
@import "components/search";
@import "components/tables";
@import "layouts/footer";
@import "layouts/header";
@import "layouts/pages";

View File

@ -291,3 +291,7 @@ body.dark .alert-primary {
body.dark .figure-caption {
color: $body-color-dark;
}
body.dark table {
@extend .table-dark;
}

View File

@ -51,6 +51,16 @@ h6,
font-size: calc(1.875rem + 1.5vw);
}
a:hover,
a:focus {
text-decoration: underline;
}
a.btn:hover,
a.btn:focus {
text-decoration: none;
}
.section {
padding-top: 5rem;
padding-bottom: 5rem;
@ -168,6 +178,11 @@ body {
}
}
.navbar a:hover,
.navbar a:focus {
text-decoration: none;
}
#TableOfContents ul {
padding-left: 0;
list-style: none;

View File

@ -15,7 +15,7 @@ $black: #000;
$yellow: #ffe000;
$black: #1d2d35;
$beige: #fbf7f0;
$red: #e55235;
// $red: #e55235;
$purple: #5d2f86;
$brown: #aa9c84;
@ -24,6 +24,25 @@ $pink-500: #d32e9d;
$primary: $purple;
// Options
//
// Quickly modify global styling by enabling or disabling optional features.
$enable-caret: true;
$enable-rounded: true;
$enable-shadows: false;
$enable-gradients: false;
$enable-transitions: true;
$enable-reduced-motion: true;
$enable-smooth-scroll: true;
$enable-grid-classes: true;
$enable-button-pointers: true;
$enable-rfs: true;
$enable-validation-icons: true;
$enable-negative-margins: true;
$enable-deprecation-messages: true;
$enable-important-utilities: true;
/** Bootstrap navbar fix (https://git.io/fADqW) */
$navbar-dark-toggler-icon-bg: none;
$navbar-light-toggler-icon-bg: none;
@ -32,7 +51,7 @@ $navbar-light-toggler-icon-bg: none;
//
// Quickly modify global styling by enabling or disabling optional features.
$enable-responsive-font-sizes: true;
// $enable-responsive-font-sizes: true;
// Body
//
@ -41,6 +60,13 @@ $enable-responsive-font-sizes: true;
$body-bg: $white;
$body-color: $black;
// Links
//
// Style anchor elements.
$link-color: $primary;
$link-decoration: none;
// Grid containers
//
// Define the maximum width of `.container` for different screen sizes.
@ -49,7 +75,8 @@ $container-max-widths: (
sm: 540px,
md: 720px,
lg: 960px,
xl: 1240px
xl: 1240px,
xxl: 1320px
);
@include _assert-ascending($container-max-widths, "$container-max-widths");
@ -102,7 +129,7 @@ $spacer: 1rem;
// Navbar
$navbar-padding-y: $spacer / 2;
$navbar-padding-x: 0;
$navbar-padding-x: null;
$navbar-nav-link-padding-x: 0.5rem;
@ -118,13 +145,13 @@ $card-border-color: $gray-200;
//
// Define alert colors, border radius, and padding.
$alert-padding-y: 1rem;
$alert-padding-x: 1.5rem;
$alert-padding-y: $spacer;
$alert-padding-x: $spacer * 1.5;
$alert-margin-bottom: 0;
$alert-border-radius: 0;
$alert-link-font-weight: $headings-font-weight;
$alert-border-width: 0;
$alert-bg-level: 0;
$alert-border-level: 0;
$alert-color-level: 0;
$alert-bg-scale: 0;
$alert-border-scale: 0;
$alert-color-scale: 0;

View File

@ -10,7 +10,7 @@ samp {
pre {
background: $beige;
color: $black;
line-height: $line-height-lg;
line-height: $line-height-base;
margin: 2rem 0;
overflow: auto;
padding: 1.25rem 1.5rem;
@ -29,7 +29,7 @@ pre code {
padding: 0;
}
@include media-breakpoint-down(xs) {
@include media-breakpoint-down(sm) {
pre {
margin: 2rem -1.5rem;
}

View File

@ -7,7 +7,7 @@
}
.comment-form p {
@extend .form-group;
@extend .form-group !optional;
}
.comment-form input[type="text"],

View File

@ -1,6 +1,6 @@
/** Search form */
.search-form {
@extend .form-inline;
@extend .form-inline !optional;
}
.search-form label {

View File

@ -0,0 +1,5 @@
table {
@extend .table;
margin: 3rem 0;
}

View File

@ -20,6 +20,10 @@
color: $body-color;
}
.navbar-light .navbar-nav .active .nav-link {
color: $primary;
}
@include media-breakpoint-up(md) {
.navbar-brand {
font-size: $font-size-xl;

View File

@ -38,3 +38,8 @@ p.meta {
margin-top: 0.5rem;
font-size: $font-size-base;
}
.breadcrumb {
margin-top: 2.25rem;
font-size: $font-size-base;
}

View File

@ -45,6 +45,12 @@ rel = "sitemap"
[markup.goldmark]
[markup.goldmark.extensions]
linkify = false
[markup.goldmark.parser]
autoHeadingID = true
autoHeadingIDType = "github"
[markup.goldmark.parser.attribute]
block = true
title = true
[markup.goldmark.renderer]
unsafe = true
[markup.highlight]

View File

@ -20,11 +20,11 @@
url = "/blog/"
weight = 20
# [[social]]
# name = "Twitter"
# pre = "<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-twitter\"><path d=\"M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z\"></path></svg>"
# url = "https://twitter.com/gethyas"
# weight = 10
[[social]]
name = "Twitter"
pre = "<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-twitter\"><path d=\"M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z\"></path></svg>"
url = "https://twitter.com/getdoks"
weight = 10
[[social]]
name = "GitHub"

View File

@ -52,3 +52,5 @@ editPage = false
instantPage = true
flexSearch = true
darkMode = true
bootStrapJs = false
breadCrumb = false

View File

@ -8,10 +8,16 @@ module.exports = {
purgecss({
content: [
'./layouts/**/*.html',
'./content/**/*.md',
'./content/**/*.md',
],
safelist: [
'lazyloaded',
'table',
'thead',
'tbody',
'tr',
'th',
'td',
...whitelister([
'./assets/scss/components/_code.scss',
'./assets/scss/components/_search.scss',

View File

@ -3,7 +3,7 @@
<div class="col-lg-5 col-xl-4 docs-sidebar">
<nav class="docs-links" aria-label="Main navigation">
{{ partial "sidebar/docs-menu.html" . }}
</nav>
</nav>
</div>
{{ if ne .Params.toc false -}}
<nav class="docs-toc d-none d-xl-block col-xl-3" aria-label="Secondary navigation">
@ -15,6 +15,15 @@
{{ else -}}
<main class="docs-content col-lg-11 col-xl-9 mx-xl-auto">
{{ end -}}
{{ if .Site.Params.options.breadCrumb -}}
<!-- https://discourse.gohugo.io/t/breadcrumb-navigation-for-highly-nested-content/27359/6 -->
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
{{ partial "main/breadcrumb" . -}}
<li class="breadcrumb-item active" aria-current="page">{{ .Title }}</li>
</ol>
</nav>
{{ end }}
<h1>{{ .Title }}</h1>
<p class="lead">{{ .Params.lead | safeHTML }}</p>
{{ partial "main/headline-hash.html" .Content }}

View File

@ -6,7 +6,7 @@
<li class="list-inline-item">{{ .Site.Params.footer | safeHTML }}</li>
</ul>
</div>
<div class="col-lg-8 order-first order-lg-last text-lg-right">
<div class="col-lg-8 order-first order-lg-last text-lg-end">
<ul class="list-inline">
{{ range .Site.Menus.footer -}}
<li class="list-inline-item"><a href="{{ .URL | absURL }}">{{ .Name }}</a></li>

View File

@ -1,6 +1,9 @@
{{ $indexTemplate := resources.Get "js/index.js" -}}
{{ $index := $indexTemplate | resources.ExecuteAsTemplate "index.js" . -}}
{{ $bs := resources.Get "js/bootstrap.js" -}}
{{ $bs := $bs | js.Build -}}
{{ $app := resources.Get "js/app.js" -}}
{{ $slice := slice $app -}}
@ -37,6 +40,9 @@
{{ $js := $slice | resources.Concat "main.js" -}}
{{ if eq (hugo.Environment) "development" -}}
{{ if .Site.Params.options.bootStrapJs -}}
<script src="{{ $bs.Permalink }}" defer></script>
{{ end -}}
<script src="{{ $js.Permalink }}" defer></script>
{{ if .Site.Params.options.flexSearch -}}
<script src="{{ $index.Permalink }}" defer></script>
@ -44,6 +50,10 @@
{{ else -}}
{{ $js := $js | minify | fingerprint "sha512" -}}
{{ $index := $index | minify | fingerprint "sha512" -}}
{{ $bs := $bs | minify | fingerprint "sha512" -}}
{{ if .Site.Params.options.bootStrapJs -}}
<script src="{{ $bs.Permalink }}" integrity="{{ $bs.Data.Integrity }}" crossorigin="anonymous" defer></script>
{{ end -}}
<script src="{{ $js.Permalink }}" integrity="{{ $js.Data.Integrity }}" crossorigin="anonymous" defer></script>
{{ if .Site.Params.options.flexSearch -}}
<script src="{{ $index.Permalink }}" integrity="{{ $index.Data.Integrity }}" crossorigin="anonymous" defer></script>

View File

@ -3,7 +3,7 @@
<div class="container">
<input class="menu-btn order-0" type="checkbox" id="menu-btn">
<label class="menu-icon d-md-none" for="menu-btn"><span class="navicon"></span></label>
<a class="navbar-brand order-1 order-md-0 mr-auto" href="{{ .Site.BaseURL | absURL }}">{{ .Site.Params.Title }}</a>
<a class="navbar-brand order-1 order-md-0 me-auto" href="{{ .Site.BaseURL | absURL }}">{{ .Site.Params.Title }}</a>
{{ if .Site.Params.options.darkMode -}}
<button id="mode" class="btn btn-link order-2 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>
@ -13,12 +13,12 @@
<ul class="navbar-nav social-nav order-3 order-md-5">
{{ range .Site.Menus.social -}}
<li class="nav-item">
<a class="nav-link" href="{{ .URL | absURL }}">{{ .Pre | safeHTML }}<span class="ml-2 sr-only">{{ .Name | safeHTML }}</span></a>
<a class="nav-link" href="{{ .URL | absURL }}">{{ .Pre | safeHTML }}<span class="ms-2 visually-hidden">{{ .Name | safeHTML }}</span></a>
</li>
{{ end -}}
</ul>
<div class="collapse navbar-collapse order-4 order-md-1">
<ul class="navbar-nav main-nav mr-auto order-5 order-md-2">
<ul class="navbar-nav main-nav me-auto order-5 order-md-2">
{{- $current := . -}}
{{ range .Site.Menus.main -}}
{{- $active := or ($current.IsMenuCurrent "main" .) ($current.HasMenuCurrent "main" .) -}}

View File

@ -0,0 +1,4 @@
{{ with .Parent -}}
{{ partial "main/breadcrumb.html" . -}}
<li class="breadcrumb-item"><a href="{{ .Permalink }}">{{ if .IsHome }}Home{{ else }}{{ .Title }}{{ end }}</a></li>
{{ end -}}

View File

@ -12,7 +12,7 @@
</a>
{{ end -}}
{{ with $pages.Prev . -}}
<a class="ml-auto" href="{{ .Permalink }}">
<a class="ms-auto" href="{{ .Permalink }}">
<div class="card my-1">
<div class="card-body py-2">
{{ .Title }} &rarr;

69
package-lock.json generated
View File

@ -5,6 +5,7 @@
"requires": true,
"packages": {
"": {
"name": "doks",
"version": "0.1.6",
"devDependencies": {
"@babel/cli": "^7.13",
@ -12,7 +13,7 @@
"@babel/preset-env": "^7.13",
"@fullhuman/postcss-purgecss": "^4.0",
"autoprefixer": "^10.2",
"bootstrap": "^4.6",
"bootstrap": "^5.0.0-beta2",
"clipboard": "^2.0",
"eslint": "^7.21",
"flexsearch": "^0.6",
@ -1388,6 +1389,17 @@
"node": ">= 8"
}
},
"node_modules/@popperjs/core": {
"version": "2.9.0",
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.9.0.tgz",
"integrity": "sha512-wjtKehFAIARq2OxK8j3JrggNlEslJfNuSm2ArteIbKyRMts2g0a7KzTxfRVNUM+O0gnBJ2hNV8nWPOYBgI1sew==",
"dev": true,
"peer": true,
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/popperjs"
}
},
"node_modules/@sindresorhus/is": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz",
@ -2424,17 +2436,16 @@
"dev": true
},
"node_modules/bootstrap": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.6.0.tgz",
"integrity": "sha512-Io55IuQY3kydzHtbGvQya3H+KorS/M9rSNyfCGCg9WZ4pyT/lCxIlpJgG1GXW/PswzC84Tr2fBYi+7+jFVQQBw==",
"version": "5.0.0-beta2",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.0.0-beta2.tgz",
"integrity": "sha512-e+uPbPHqTQWKyCX435uVlOmgH9tUt0xtjvyOC7knhKgOS643BrQKuTo+KecGpPV7qlmOyZgCfaM4xxPWtDEN/g==",
"dev": true,
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/bootstrap"
},
"peerDependencies": {
"jquery": "1.9.1 - 3",
"popper.js": "^1.16.1"
"@popperjs/core": "^2.6.0"
}
},
"node_modules/brace-expansion": {
@ -7375,13 +7386,6 @@
"node": ">= 4"
}
},
"node_modules/jquery": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz",
"integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==",
"dev": true,
"peer": true
},
"node_modules/js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
@ -9611,18 +9615,6 @@
"node": ">=8"
}
},
"node_modules/popper.js": {
"version": "1.16.1",
"resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1.tgz",
"integrity": "sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ==",
"deprecated": "You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1",
"dev": true,
"peer": true,
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/popperjs"
}
},
"node_modules/posix-character-classes": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz",
@ -15164,6 +15156,13 @@
"fastq": "^1.6.0"
}
},
"@popperjs/core": {
"version": "2.9.0",
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.9.0.tgz",
"integrity": "sha512-wjtKehFAIARq2OxK8j3JrggNlEslJfNuSm2ArteIbKyRMts2g0a7KzTxfRVNUM+O0gnBJ2hNV8nWPOYBgI1sew==",
"dev": true,
"peer": true
},
"@sindresorhus/is": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz",
@ -16013,9 +16012,9 @@
}
},
"bootstrap": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.6.0.tgz",
"integrity": "sha512-Io55IuQY3kydzHtbGvQya3H+KorS/M9rSNyfCGCg9WZ4pyT/lCxIlpJgG1GXW/PswzC84Tr2fBYi+7+jFVQQBw==",
"version": "5.0.0-beta2",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.0.0-beta2.tgz",
"integrity": "sha512-e+uPbPHqTQWKyCX435uVlOmgH9tUt0xtjvyOC7knhKgOS643BrQKuTo+KecGpPV7qlmOyZgCfaM4xxPWtDEN/g==",
"dev": true,
"requires": {}
},
@ -19961,13 +19960,6 @@
"is-object": "^1.0.1"
}
},
"jquery": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz",
"integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==",
"dev": true,
"peer": true
},
"js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
@ -21738,13 +21730,6 @@
}
}
},
"popper.js": {
"version": "1.16.1",
"resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1.tgz",
"integrity": "sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ==",
"dev": true,
"peer": true
},
"posix-character-classes": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz",

View File

@ -36,7 +36,7 @@
"@babel/preset-env": "^7.13",
"@fullhuman/postcss-purgecss": "^4.0",
"autoprefixer": "^10.2",
"bootstrap": "^4.6",
"bootstrap": "^5.0.0-beta2",
"clipboard": "^2.0",
"eslint": "^7.21",
"flexsearch": "^0.6",