feat: update bootstrap to 5.0.0-beta2

This commit is contained in:
Henk Verlinde 2021-03-04 17:53:25 +01:00
parent 6e5867dbf0
commit 22afec709a
14 changed files with 86 additions and 65 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

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

View File

@ -15,7 +15,7 @@ $black: #000;
$yellow: #ffe000; $yellow: #ffe000;
$black: #1d2d35; $black: #1d2d35;
$beige: #fbf7f0; $beige: #fbf7f0;
$red: #e55235; // $red: #e55235;
$purple: #5d2f86; $purple: #5d2f86;
$brown: #aa9c84; $brown: #aa9c84;
@ -32,7 +32,7 @@ $navbar-light-toggler-icon-bg: none;
// //
// Quickly modify global styling by enabling or disabling optional features. // Quickly modify global styling by enabling or disabling optional features.
$enable-responsive-font-sizes: true; // $enable-responsive-font-sizes: true;
// Body // Body
// //
@ -41,6 +41,13 @@ $enable-responsive-font-sizes: true;
$body-bg: $white; $body-bg: $white;
$body-color: $black; $body-color: $black;
// Links
//
// Style anchor elements.
$link-color: $primary;
$link-decoration: none;
// Grid containers // Grid containers
// //
// Define the maximum width of `.container` for different screen sizes. // Define the maximum width of `.container` for different screen sizes.
@ -49,7 +56,8 @@ $container-max-widths: (
sm: 540px, sm: 540px,
md: 720px, md: 720px,
lg: 960px, lg: 960px,
xl: 1240px xl: 1240px,
xxl: 1320px
); );
@include _assert-ascending($container-max-widths, "$container-max-widths"); @include _assert-ascending($container-max-widths, "$container-max-widths");
@ -102,7 +110,7 @@ $spacer: 1rem;
// Navbar // Navbar
$navbar-padding-y: $spacer / 2; $navbar-padding-y: $spacer / 2;
$navbar-padding-x: 0; $navbar-padding-x: null;
$navbar-nav-link-padding-x: 0.5rem; $navbar-nav-link-padding-x: 0.5rem;
@ -118,13 +126,13 @@ $card-border-color: $gray-200;
// //
// Define alert colors, border radius, and padding. // Define alert colors, border radius, and padding.
$alert-padding-y: 1rem; $alert-padding-y: $spacer;
$alert-padding-x: 1.5rem; $alert-padding-x: $spacer * 1.5;
$alert-margin-bottom: 0; $alert-margin-bottom: 0;
$alert-border-radius: 0; $alert-border-radius: 0;
$alert-link-font-weight: $headings-font-weight; $alert-link-font-weight: $headings-font-weight;
$alert-border-width: 0; $alert-border-width: 0;
$alert-bg-level: 0; $alert-bg-scale: 0;
$alert-border-level: 0; $alert-border-scale: 0;
$alert-color-level: 0; $alert-color-scale: 0;

View File

@ -29,7 +29,7 @@ pre code {
padding: 0; padding: 0;
} }
@include media-breakpoint-down(xs) { @include media-breakpoint-down(sm) {
pre { pre {
margin: 2rem -1.5rem; margin: 2rem -1.5rem;
} }

View File

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

View File

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

View File

@ -20,11 +20,11 @@
url = "/blog/" url = "/blog/"
weight = 20 weight = 20
# [[social]] [[social]]
# name = "Twitter" 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>" 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" url = "https://twitter.com/getdoks"
# weight = 10 weight = 10
[[social]] [[social]]
name = "GitHub" name = "GitHub"

View File

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

View File

@ -6,7 +6,7 @@
<li class="list-inline-item">{{ .Site.Params.footer | safeHTML }}</li> <li class="list-inline-item">{{ .Site.Params.footer | safeHTML }}</li>
</ul> </ul>
</div> </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"> <ul class="list-inline">
{{ range .Site.Menus.footer -}} {{ range .Site.Menus.footer -}}
<li class="list-inline-item"><a href="{{ .URL | absURL }}">{{ .Name }}</a></li> <li class="list-inline-item"><a href="{{ .URL | absURL }}">{{ .Name }}</a></li>

View File

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

View File

@ -3,7 +3,7 @@
<div class="container"> <div class="container">
<input class="menu-btn order-0" type="checkbox" id="menu-btn"> <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> <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 -}} {{ if .Site.Params.options.darkMode -}}
<button id="mode" class="btn btn-link order-2 order-md-4" type="button" aria-label="Toggle mode"> <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> <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"> <ul class="navbar-nav social-nav order-3 order-md-5">
{{ range .Site.Menus.social -}} {{ range .Site.Menus.social -}}
<li class="nav-item"> <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> </li>
{{ end -}} {{ end -}}
</ul> </ul>
<div class="collapse navbar-collapse order-4 order-md-1"> <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 := . -}} {{- $current := . -}}
{{ range .Site.Menus.main -}} {{ range .Site.Menus.main -}}
{{- $active := or ($current.IsMenuCurrent "main" .) ($current.HasMenuCurrent "main" .) -}} {{- $active := or ($current.IsMenuCurrent "main" .) ($current.HasMenuCurrent "main" .) -}}

View File

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

69
package-lock.json generated
View File

@ -5,6 +5,7 @@
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "doks",
"version": "0.1.6", "version": "0.1.6",
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.13", "@babel/cli": "^7.13",
@ -12,7 +13,7 @@
"@babel/preset-env": "^7.13", "@babel/preset-env": "^7.13",
"@fullhuman/postcss-purgecss": "^4.0", "@fullhuman/postcss-purgecss": "^4.0",
"autoprefixer": "^10.2", "autoprefixer": "^10.2",
"bootstrap": "^4.6", "bootstrap": "^5.0.0-beta2",
"clipboard": "^2.0", "clipboard": "^2.0",
"eslint": "^7.21", "eslint": "^7.21",
"flexsearch": "^0.6", "flexsearch": "^0.6",
@ -1388,6 +1389,17 @@
"node": ">= 8" "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": { "node_modules/@sindresorhus/is": {
"version": "0.7.0", "version": "0.7.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz",
@ -2424,17 +2436,16 @@
"dev": true "dev": true
}, },
"node_modules/bootstrap": { "node_modules/bootstrap": {
"version": "4.6.0", "version": "5.0.0-beta2",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.6.0.tgz", "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.0.0-beta2.tgz",
"integrity": "sha512-Io55IuQY3kydzHtbGvQya3H+KorS/M9rSNyfCGCg9WZ4pyT/lCxIlpJgG1GXW/PswzC84Tr2fBYi+7+jFVQQBw==", "integrity": "sha512-e+uPbPHqTQWKyCX435uVlOmgH9tUt0xtjvyOC7knhKgOS643BrQKuTo+KecGpPV7qlmOyZgCfaM4xxPWtDEN/g==",
"dev": true, "dev": true,
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
"url": "https://opencollective.com/bootstrap" "url": "https://opencollective.com/bootstrap"
}, },
"peerDependencies": { "peerDependencies": {
"jquery": "1.9.1 - 3", "@popperjs/core": "^2.6.0"
"popper.js": "^1.16.1"
} }
}, },
"node_modules/brace-expansion": { "node_modules/brace-expansion": {
@ -7375,13 +7386,6 @@
"node": ">= 4" "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": { "node_modules/js-tokens": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
@ -9608,18 +9612,6 @@
"node": ">=8" "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": { "node_modules/posix-character-classes": {
"version": "0.1.1", "version": "0.1.1",
"resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz",
@ -15161,6 +15153,13 @@
"fastq": "^1.6.0" "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": { "@sindresorhus/is": {
"version": "0.7.0", "version": "0.7.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz",
@ -16010,9 +16009,9 @@
} }
}, },
"bootstrap": { "bootstrap": {
"version": "4.6.0", "version": "5.0.0-beta2",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.6.0.tgz", "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.0.0-beta2.tgz",
"integrity": "sha512-Io55IuQY3kydzHtbGvQya3H+KorS/M9rSNyfCGCg9WZ4pyT/lCxIlpJgG1GXW/PswzC84Tr2fBYi+7+jFVQQBw==", "integrity": "sha512-e+uPbPHqTQWKyCX435uVlOmgH9tUt0xtjvyOC7knhKgOS643BrQKuTo+KecGpPV7qlmOyZgCfaM4xxPWtDEN/g==",
"dev": true, "dev": true,
"requires": {} "requires": {}
}, },
@ -19958,13 +19957,6 @@
"is-object": "^1.0.1" "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": { "js-tokens": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
@ -21735,13 +21727,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": { "posix-character-classes": {
"version": "0.1.1", "version": "0.1.1",
"resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", "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", "@babel/preset-env": "^7.13",
"@fullhuman/postcss-purgecss": "^4.0", "@fullhuman/postcss-purgecss": "^4.0",
"autoprefixer": "^10.2", "autoprefixer": "^10.2",
"bootstrap": "^4.6", "bootstrap": "^5.0.0-beta2",
"clipboard": "^2.0", "clipboard": "^2.0",
"eslint": "^7.21", "eslint": "^7.21",
"flexsearch": "^0.6", "flexsearch": "^0.6",