diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..b15c6e6 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: # Replace with a single Patreon username +open_collective: doks # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.gitignore b/.gitignore index a4f7c60..8f187f0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -bin node_modules public resources diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d918e7..084c3b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,35 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v0.3.5](https://github.com/h-enk/doks/compare/v0.3.4...v0.3.5) + +- feat: add versioning setup [`#478`](https://github.com/h-enk/doks/pull/478) +- feat: adjust latex svg image to dark theme [`#460`](https://github.com/h-enk/doks/pull/460) +- fix: edit-page multi-language support [`#459`](https://github.com/h-enk/doks/pull/459) +- feat: add docsRepoBranch config [`#458`](https://github.com/h-enk/doks/pull/458) +- feat: image max width [`#457`](https://github.com/h-enk/doks/pull/457) +- fix: docs url [`#456`](https://github.com/h-enk/doks/pull/456) +- chore(deps-dev): bump @babel/cli from 7.15.4 to 7.15.7 [`#463`](https://github.com/h-enk/doks/pull/463) +- feat: add multilingual support [`#454`](https://github.com/h-enk/doks/pull/454) +- deps: bump versions to latest [`94bacd3`](https://github.com/h-enk/doks/commit/94bacd3492e7b4d1e46aef13f86e5924ac645f4e) +- deps: bump @babel/cli from 7.15.4 to 7.15.7 [`130a13b`](https://github.com/h-enk/doks/commit/130a13bd9d3891d995e7373cc9a64fa527b4ce26) +- deps: bump versions to latest [`2503f5a`](https://github.com/h-enk/doks/commit/2503f5adf6d2650b82928a8770c2a1ccdc368a0c) + +#### [v0.3.4](https://github.com/h-enk/doks/compare/v0.3.3...v0.3.4) + +> 7 September 2021 + +- chore: update edit page default branch from master to main [`#426`](https://github.com/h-enk/doks/pull/426) +- Update index.js [`#417`](https://github.com/h-enk/doks/pull/417) +- Make id unique collapsible sidebar [`#378`](https://github.com/h-enk/doks/pull/378) +- deps: bump versions to latest [`8a98716`](https://github.com/h-enk/doks/commit/8a9871654e03b79082cfd9ebdf49a0a8ce7e21eb) +- deps: bump version to latest [`23d9dd7`](https://github.com/h-enk/doks/commit/23d9dd75c381b0440f4db717d63bea61baa0c584) +- deps: bump versions to latest [`700e566`](https://github.com/h-enk/doks/commit/700e56611d3a83f33e786f51a191728db7267248) + #### [v0.3.3](https://github.com/h-enk/doks/compare/v0.3.2...v0.3.3) +> 5 July 2021 + - Add Mermaid support [`#369`](https://github.com/h-enk/doks/pull/369) - Fix lint tests on Linux. [`#373`](https://github.com/h-enk/doks/pull/373) - feat: add mermaid [`f1fa5c5`](https://github.com/h-enk/doks/commit/f1fa5c5936558ff0b62d8a150bf303629bf50840) diff --git a/README.md b/README.md index 6cf137d..a703451 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,11 @@

- Modern documentation theme + Modern Documentation Theme

- Doks is a Hugo theme helping you build modern documentation websites that are secure, fast, and SEO-ready — by default. + Doks is a Hugo theme for building secure, fast, and SEO-ready documentation websites, which you can easily update and customize.

@@ -23,6 +23,9 @@ GitHub release (latest SemVer including pre-releases) + + npm (scoped) + GitHub Workflow Status (branch) @@ -39,7 +42,7 @@ ## Why Doks? -Nine reasons why you should use Doks: +Nine main reasons why you should use Doks: 1. __Security aware__. Get A+ scores on [Mozilla Observatory](https://observatory.mozilla.org/analyze/doks.netlify.app) out of the box. Easily change the default Security Headers to suit your needs. @@ -59,6 +62,14 @@ Nine reasons why you should use Doks: 9. __Dark mode__. Switch to a low-light UI with the click of a button. Change colors with variables to match your branding. +### Other features + +- __Multilingual and i18n__ support +- __Versioning__ documentation support +- __KaTeX__ math typesetting +- __Mermaid__ diagrams and visualization +- __highlight.js__ syntax highlighting + ## Requirements Doks uses npm to centralize dependency management, making it [easy to update](https://getdoks.org/docs/help/how-to-update/) resources, build tooling, plugins, and build scripts: @@ -117,3 +128,15 @@ Doks comes with [commands](https://getdoks.org/docs/prologue/commands/) for comm - [Netlify Community](https://community.netlify.com/) - [Hugo Forums](https://discourse.gohugo.io/) - [Doks Discussions](https://github.com/h-enk/doks/discussions) + +## Sponsors + +Support this project by becoming a sponsor. Your logo will show up here with a link to your website. + +[![OC sponsor 0](https://opencollective.com/doks/sponsor/0/avatar.svg)](https://opencollective.com/doks/sponsor/0/website) + +## Backers + +Support this project by becoming a backer. Your avatar will show up here. + +[![Backers](https://opencollective.com/doks/backers.svg)](https://opencollective.com/doks) diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..4ad3369 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,7 @@ +# Reporting Security Issues + +The Doks team and community take security issues in Doks seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions. + +To report a security issue, email [security@getdoks.org](mailto:security@getdoks.org) and include the word "SECURITY" in the subject line. + +We'll endeavor to respond quickly, and will keep you updated throughout the process. diff --git a/assets/js/alert.js b/assets/js/alert.js new file mode 100644 index 0000000..0fb2864 --- /dev/null +++ b/assets/js/alert.js @@ -0,0 +1,17 @@ +var announcement = document.getElementById('announcement'); + +if (announcement !== null) { + + if (localStorage.getItem('announcement') === null ) { + + announcement.classList.remove('d-none'); + + } + + announcement.addEventListener('closed.bs.alert', () => { + + localStorage.setItem('announcement', 'closed'); + + }); + +} diff --git a/assets/js/darkmode-init.js b/assets/js/darkmode-init.js new file mode 100644 index 0000000..0f3508d --- /dev/null +++ b/assets/js/darkmode-init.js @@ -0,0 +1,21 @@ +const globalDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; +const localMode = localStorage.getItem('theme'); + +if (globalDark && (localMode === null)) { + + localStorage.setItem('theme', 'dark'); + document.documentElement.setAttribute('data-dark-mode', ''); + +} + +if (globalDark && (localMode === 'dark')) { + + document.documentElement.setAttribute('data-dark-mode', ''); + +} + +if (localMode === 'dark') { + + document.documentElement.setAttribute('data-dark-mode', ''); + +} diff --git a/assets/js/darkmode.js b/assets/js/darkmode.js index 4d8bcce..e81db47 100644 --- a/assets/js/darkmode.js +++ b/assets/js/darkmode.js @@ -1,12 +1,38 @@ -document.getElementById('mode').addEventListener('click', () => { +const mode = document.getElementById('mode'); - document.body.classList.toggle('dark'); - localStorage.setItem('theme', document.body.classList.contains('dark') ? 'dark' : 'light'); +if (mode !== null) { -}); + window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => { -if (localStorage.getItem('theme') === 'dark') { + if (event.matches) { - document.body.classList.add('dark'); + localStorage.setItem('theme', 'dark'); + document.documentElement.setAttribute('data-dark-mode', ''); + + } else { + + localStorage.setItem('theme', 'light'); + document.documentElement.removeAttribute('data-dark-mode'); + + } + + }) + + mode.addEventListener('click', () => { + + document.documentElement.toggleAttribute('data-dark-mode'); + localStorage.setItem('theme', document.documentElement.hasAttribute('data-dark-mode') ? 'dark' : 'light'); + + }); + + if (localStorage.getItem('theme') === 'dark') { + + document.documentElement.setAttribute('data-dark-mode', ''); + + } else { + + document.documentElement.removeAttribute('data-dark-mode'); + + } } diff --git a/assets/js/index.js b/assets/js/index.js index 0df2fd2..c10a58b 100644 --- a/assets/js/index.js +++ b/assets/js/index.js @@ -1,20 +1,19 @@ var suggestions = document.getElementById('suggestions'); -var userinput = document.getElementById('userinput'); +var search = document.getElementById('search'); -document.addEventListener('keydown', inputFocus); +if (search !== null) { + document.addEventListener('keydown', inputFocus); +} function inputFocus(e) { - - if (e.keyCode === 191 ) { + if (e.ctrlKey && e.key === '/' ) { e.preventDefault(); - userinput.focus(); + search.focus(); } - - if (e.keyCode === 27 ) { - userinput.blur(); + if (e.key === 'Escape' ) { + search.blur(); suggestions.classList.add('d-none'); } - } document.addEventListener('click', function(event) { @@ -40,14 +39,16 @@ function suggestionFocus(e){ const focusable= [...focusableSuggestions]; const index = focusable.indexOf(document.activeElement); + const keyDefault = suggestions.classList.contains('d-none'); + let nextIndex = 0; - if (e.keyCode === 38) { + if ((e.keyCode === 38) && (!keyDefault)) { e.preventDefault(); nextIndex= index > 0 ? index-1 : 0; focusableSuggestions[nextIndex].focus(); } - else if (e.keyCode === 40) { + else if ((e.keyCode === 40) && (!keyDefault)) { e.preventDefault(); nextIndex= index+1 < focusable.length ? index+1 : index; focusableSuggestions[nextIndex].focus(); @@ -55,7 +56,6 @@ function suggestionFocus(e){ } - /* Source: - https://github.com/nextapps-de/flexsearch#index-documents-field-search @@ -102,7 +102,7 @@ Source: {{ range $index, $element := $list -}} { id: {{ $index }}, - href: "{{ .Permalink }}", + href: "{{ .RelPermalink }}", title: {{ .Title | jsonify }}, description: {{ .Params.description | jsonify }}, content: {{ .Content | jsonify }} @@ -113,43 +113,40 @@ Source: {{ end -}} ; - userinput.addEventListener('input', show_results, true); + search.addEventListener('input', show_results, true); suggestions.addEventListener('click', accept_suggestion, true); function show_results(){ + const maxResult = 5; var value = this.value; - var results = index.search(value, { limit: 5, index: ["content"], enrich: true }); - var entry, childs = suggestions.childNodes; - var i = 0, len = results.length; + var results = index.search(value, {limit: maxResult, enrich: true}); suggestions.classList.remove('d-none'); + suggestions.innerHTML = ""; - results.forEach(function(results) { - - entry = document.createElement('div'); - - entry.innerHTML = ''; - - a = entry.querySelector('a'), - t = entry.querySelector('span:first-child'), - d = entry.querySelector('span:nth-child(2)'); - - // console.log(results); - - a.href = results.result[i].doc.href; - t.textContent = results.result[i].doc.title; - d.textContent = results.result[i].doc.description; - - suggestions.appendChild(entry); - + //flatSearch now returns results for each index field. create a single list + const flatResults = {}; //keyed by href to dedupe results + results.forEach(result=>{ + result.result.forEach(r=>{ + flatResults[r.doc.href] = r.doc; + }); }); - while(childs.length > len){ + //construct a list of suggestions list + for(const href in flatResults) { + const doc = flatResults[href]; - suggestions.removeChild(childs[i]) + const entry = document.createElement('div'); + entry.innerHTML = ''; + + entry.querySelector('a').href = href; + entry.querySelector('span:first-child').textContent = doc.title; + entry.querySelector('span:nth-child(2)').textContent = doc.description; + + suggestions.appendChild(entry); + if(suggestions.childElementCount == maxResult) break; } - } function accept_suggestion(){ diff --git a/assets/scss/common/_dark.scss b/assets/scss/common/_dark.scss index 479dfc1..81f30c0 100644 --- a/assets/scss/common/_dark.scss +++ b/assets/scss/common/_dark.scss @@ -4,7 +4,11 @@ $body-bg-dark: $gray-900; $body-overlay-dark: darken($body-bg-dark, 2.5%); + +/* $border-dark: darken($body-bg-dark, 2.5%); +*/ +$border-dark: $gray-800; $body-color-dark: $gray-300; $dots-dark: darken($body-color-dark, 50%); @@ -18,118 +22,165 @@ $navbar-dark-active-color: $link-color-dark; /** Theme styles */ -body.dark { +[data-dark-mode] body { background: $body-bg-dark; color: $body-color-dark; } -body.dark a { +[data-dark-mode] body a { color: $link-color-dark; } -body.dark a.text-body { +[data-dark-mode] body a.text-body { color: $body-color-dark !important; } -body.dark .btn-primary { +[data-dark-mode] body .btn-primary { @include button-variant($button-color-dark, $button-color-dark); color: $body-bg-dark !important; } -body.dark .btn-outline-primary { +[data-dark-mode] body .btn-outline-primary { @include button-outline-variant($button-color-dark, $button-color-dark); color: $link-color-dark; } -body.dark .btn-outline-primary:hover { +[data-dark-mode] body .btn-outline-primary:hover { color: $body-bg-dark; } -body.dark .navbar { - background: $body-bg-dark; - opacity: 0.975; +[data-dark-mode] body .btn-doks-light { + color: $navbar-dark-color; +} + +[data-dark-mode] body .show > .btn-doks-light, +[data-dark-mode] body .btn-doks-light:hover, +[data-dark-mode] body .btn-doks-light:active { + color: $link-color-dark; +} + +[data-dark-mode] body .btn-menu svg { + color: $body-color-dark; +} + +[data-dark-mode] body .doks-sidebar-toggle { + color: $navbar-dark-color; +} + +[data-dark-mode] body .btn-menu:hover, +[data-dark-mode] body .btn-doks-light:hover, +[data-dark-mode] body .doks-sidebar-toggle:hover { + background: $body-overlay-dark; +} + +/* +[data-dark-mode] body .dropdown-menu { + @extend .dropdown-menu-dark; +} +*/ + +[data-dark-mode] body .navbar, +[data-dark-mode] body .doks-subnavbar { + background-color: rgba(33, 37, 41, 0.95); border-bottom: 1px solid $border-dark; } -body.dark.home .navbar { +[data-dark-mode] body.home .navbar { border-bottom: 0; } -body.dark .navbar-light .navbar-brand { +[data-dark-mode] body .offcanvas-header { + border-bottom: 1px solid $gray-800; +} + +[data-dark-mode] body .offcanvas .nav-link { + color: $body-color-dark; +} + +[data-dark-mode] body .offcanvas .nav-link:hover, +[data-dark-mode] body .offcanvas .nav-link:focus { + color: $link-color-dark; +} + +[data-dark-mode] body .offcanvas .nav-link.active { + color: $link-color-dark; +} + +[data-dark-mode] body .navbar-light .navbar-brand { color: $navbar-dark-color !important; } -body.dark .navbar-light .navbar-nav .nav-link { +[data-dark-mode] body .navbar-light .navbar-nav .nav-link { color: $navbar-dark-color; } -body.dark .navbar-light .navbar-nav .nav-link:hover, -body.dark .navbar-light .navbar-nav .nav-link:focus { +[data-dark-mode] body .navbar-light .navbar-nav .nav-link:hover, +[data-dark-mode] body .navbar-light .navbar-nav .nav-link:focus { color: $navbar-dark-hover-color; } -body.dark .navbar-light .navbar-nav .nav-link.disabled { +[data-dark-mode] body .navbar-light .navbar-nav .nav-link.disabled { color: $navbar-dark-disabled-color; } -body.dark .navbar-light .navbar-nav .show > .nav-link, -body.dark .navbar-light .navbar-nav .active > .nav-link, -body.dark .navbar-light .navbar-nav .nav-link.show, -body.dark .navbar-light .navbar-nav .nav-link.active { +[data-dark-mode] body .navbar-light .navbar-nav .show > .nav-link, +[data-dark-mode] body .navbar-light .navbar-nav .active > .nav-link, +[data-dark-mode] body .navbar-light .navbar-nav .nav-link.show, +[data-dark-mode] body .navbar-light .navbar-nav .nav-link.active { color: $navbar-dark-active-color; } -body.dark .navbar-light .navbar-text { +[data-dark-mode] body .navbar-light .navbar-text { color: $navbar-dark-color; } -body.dark .alert-primary a { +[data-dark-mode] body .alert-primary a { color: $body-bg-dark; } -body.dark .alert-warning { +[data-dark-mode] body .alert-warning { background: $body-overlay-dark; color: $body-color-dark; } -body.dark .page-links a { +[data-dark-mode] body .page-links a { color: $body-color-dark; } -body.dark .btn-toggle-nav a { +[data-dark-mode] body .btn-toggle-nav a { color: $body-color-dark; } -body.dark .showcase-meta a { +[data-dark-mode] body .showcase-meta a { color: $body-color-dark; } -body.dark .showcase-meta a:hover, -body.dark .showcase-meta a:focus { +[data-dark-mode] body .showcase-meta a:hover, +[data-dark-mode] body .showcase-meta a:focus { color: $link-color-dark; } -body.dark .docs-link:hover, -body.dark .docs-link.active, -body.dark .page-links a:hover { +[data-dark-mode] body .docs-link:hover, +[data-dark-mode] body .docs-link.active, +[data-dark-mode] body .page-links a:hover { text-decoration: none; color: $link-color-dark; } -body.dark .btn-toggle { +[data-dark-mode] body .btn-toggle { color: $body-color-dark; background-color: transparent; border: 0; } -body.dark .btn-toggle:hover, -body.dark .btn-toggle:focus { +[data-dark-mode] body .btn-toggle:hover, +[data-dark-mode] body .btn-toggle:focus { color: $body-color-dark; } -body.dark .btn-toggle::before { +[data-dark-mode] body .btn-toggle::before { width: 1.25em; line-height: 0; content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%28222, 226, 230, 0.75%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e"); @@ -138,59 +189,65 @@ body.dark .btn-toggle::before { margin-bottom: 0.125rem; } -body.dark .btn-toggle[aria-expanded="true"] { +[data-dark-mode] body .btn-toggle[aria-expanded="true"] { color: $body-color-dark; } -body.dark .btn-toggle[aria-expanded="true"]::before { +[data-dark-mode] body .btn-toggle[aria-expanded="true"]::before { transform: rotate(90deg); } -body.dark .btn-toggle-nav a:hover, -body.dark .btn-toggle-nav a:focus { +[data-dark-mode] body .btn-toggle-nav a:hover, +[data-dark-mode] body .btn-toggle-nav a:focus { color: $link-color-dark; } -body.dark .btn-toggle-nav a.active { +[data-dark-mode] body .btn-toggle-nav a.active { color: $link-color-dark; } -body.dark .navbar-light .navbar-text a { +[data-dark-mode] body .navbar-light .navbar-text a { color: $navbar-dark-active-color; } -body.dark .docs-links h3.sidebar-link a, -body.dark .page-links h3.sidebar-link a { +[data-dark-mode] body .docs-links h3.sidebar-link a, +[data-dark-mode] body .page-links h3.sidebar-link a { color: $body-color-dark; } -body.dark .navbar-light .navbar-text a:hover, -body.dark .navbar-light .navbar-text a:focus { +[data-dark-mode] body .navbar-light .navbar-text a:hover, +[data-dark-mode] body .navbar-light .navbar-text a:focus { color: $navbar-dark-active-color; } -body.dark .navbar .btn-link { +[data-dark-mode] body .navbar .btn-link { color: $navbar-dark-color; } -body.dark .content .btn-link { +[data-dark-mode] body .content .btn-link { color: $link-color-dark; } -body.dark .content .btn-link:hover { +[data-dark-mode] body .content .btn-link:hover { color: $link-color-dark; } -body.dark .navbar .btn-link:hover { +[data-dark-mode] body .content img[src^="https://latex.codecogs.com/svg.latex"] { + filter: invert(1); +} + +[data-dark-mode] body .navbar .btn-link:hover { color: $navbar-dark-hover-color; } -body.dark .navbar .btn-link:active { +[data-dark-mode] body .navbar .btn-link:active { color: $navbar-dark-active-color; } -body.dark .form-control.is-search { +[data-dark-mode] body .form-control.is-search { background: $body-overlay-dark; + border: 1px solid transparent; + color: $gray-300; /* background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-search'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E"); @@ -200,180 +257,269 @@ body.dark .form-control.is-search { */ } -body.dark .navbar-form::after { +[data-dark-mode] body .form-control.is-search:focus { + border: 1px solid $link-color-dark; +} + +[data-dark-mode] body .doks-search::after { + color: $gray-300; + border: 1px solid $gray-700; +} + +[data-dark-mode] body .text-dark { + color: $body-color-dark !important; +} + +/* +[data-dark-mode] body .navbar-form::after { color: $gray-600; border: 1px solid $gray-800; } +*/ -body.dark .form-control { - color: $gray-500; +[data-dark-mode] body .form-control { + color: $gray-300; } -body.dark .form-control:focus { - box-shadow: 0 0 0 0.2rem $focus-color-dark; +[data-dark-mode] body .form-control::placeholder { + color: $gray-400; + opacity: 1; } -body.dark .border-top { +[data-dark-mode] body .border-top { border-top: 1px solid $border-dark !important; } @include media-breakpoint-up(lg) { - body.dark .docs-sidebar { + [data-dark-mode] body .docs-sidebar { order: 0; border-right: 1px solid $border-dark; } } -body.dark .docs-navigation { +[data-dark-mode] body .docs-navigation { border-top: 1px solid $border-dark; } -body.dark pre code::-webkit-scrollbar-thumb { +[data-dark-mode] body pre code::-webkit-scrollbar-thumb { background: $gray-400; } -body.dark pre code:hover { - scrollbar-width: thin; - scrollbar-color: $border-dark transparent; -} - -body.dark pre code::-webkit-scrollbar-thumb:hover { - background: $gray-500; -} - -body.dark code:not(.hljs):not(.language-mermaid) { +[data-dark-mode] body code:not(.hljs) { background: $body-overlay-dark; color: $body-color-dark; } -body.dark .mermaid, -body.dark pre code.language-mermaid { - background: $white; +[data-dark-mode] body pre code:hover { + scrollbar-width: thin; + scrollbar-color: $border-dark transparent; } -body.dark blockquote { +[data-dark-mode] body pre code::-webkit-scrollbar-thumb:hover { + background: $gray-500; +} + +[data-dark-mode] body blockquote { border-left: 3px solid $border-dark; } -body.dark .footer { +[data-dark-mode] body .footer { border-top: 1px solid $border-dark; } -body.dark .docs-links, -body.dark .docs-toc { +[data-dark-mode] body .docs-links, +[data-dark-mode] body .docs-toc { scrollbar-width: thin; scrollbar-color: $body-bg-dark $body-bg-dark; } -body.dark .docs-links::-webkit-scrollbar, -body.dark .docs-toc::-webkit-scrollbar { +[data-dark-mode] body .docs-links::-webkit-scrollbar, +[data-dark-mode] body .docs-toc::-webkit-scrollbar { width: 5px; } -body.dark .docs-links::-webkit-scrollbar-track, -body.dark .docs-toc::-webkit-scrollbar-track { +[data-dark-mode] body .docs-links::-webkit-scrollbar-track, +[data-dark-mode] body .docs-toc::-webkit-scrollbar-track { background: $body-bg-dark; } -body.dark .docs-links::-webkit-scrollbar-thumb, -body.dark .docs-toc::-webkit-scrollbar-thumb { +[data-dark-mode] body .docs-links::-webkit-scrollbar-thumb, +[data-dark-mode] body .docs-toc::-webkit-scrollbar-thumb { background: $body-bg-dark; } -body.dark .docs-links:hover, -body.dark .docs-toc:hover { +[data-dark-mode] body .docs-links:hover, +[data-dark-mode] body .docs-toc:hover { scrollbar-width: thin; scrollbar-color: $border-dark $body-bg-dark; } -body.dark .docs-links:hover::-webkit-scrollbar-thumb, -body.dark .docs-toc:hover::-webkit-scrollbar-thumb { +[data-dark-mode] body .docs-links:hover::-webkit-scrollbar-thumb, +[data-dark-mode] body .docs-toc:hover::-webkit-scrollbar-thumb { background: $border-dark; } -body.dark .docs-links::-webkit-scrollbar-thumb:hover, -body.dark .docs-toc::-webkit-scrollbar-thumb:hover { +[data-dark-mode] body .docs-links::-webkit-scrollbar-thumb:hover, +[data-dark-mode] body .docs-toc::-webkit-scrollbar-thumb:hover { background: $border-dark; } -body.dark .docs-links h3:not(:first-child) { +[data-dark-mode] body .docs-links h3:not(:first-child) { border-top: 1px solid $border-dark; } -body.dark a.docs-link { +[data-dark-mode] body a.docs-link { color: $body-color-dark; } -body.dark .page-links li:not(:first-child) { +[data-dark-mode] body .page-links li:not(:first-child) { border-top: 1px dashed $border-dark; } -body.dark .card { +[data-dark-mode] body .card { background: $body-bg-dark; border: 1px solid $border-dark; } -body.dark .card.bg-light { +[data-dark-mode] body .card.bg-light { background: $body-overlay-dark !important; } -body.dark .navbar .menu-icon .navicon { +[data-dark-mode] body .navbar .menu-icon .navicon { background: $navbar-dark-color; } -body.dark .navbar .menu-icon .navicon::before, -body.dark .navbar .menu-icon .navicon::after { +[data-dark-mode] body .navbar .menu-icon .navicon::before, +[data-dark-mode] body .navbar .menu-icon .navicon::after { background: $navbar-dark-color; } -body.dark .logo-light { +[data-dark-mode] body .logo-light { display: none !important; } -body.dark .logo-dark { +[data-dark-mode] body .logo-dark { display: inline-block !important; } -body.dark .bg-light { +[data-dark-mode] body .bg-light { background: darken($body-bg-dark, 1.5%) !important; } -body.dark .bg-dots { +[data-dark-mode] body .bg-dots { background-image: radial-gradient($dots-dark 15%, transparent 15%); } -body.dark .text-muted { +[data-dark-mode] body .text-muted { color: darken($body-color-dark, 7.5%) !important; } -body.dark .alert-primary { +[data-dark-mode] body .alert-primary { background: $link-color-dark; color: $body-bg-dark; } -body.dark .figure-caption { +[data-dark-mode] body .figure-caption { color: $body-color-dark; } -body.dark table { +[data-dark-mode] body table { @extend .table-dark; } -body.dark .copy-status::after { +[data-dark-mode] body .copy-status::after { content: "Copy"; display: block; color: $body-color-dark; } -body.dark .copy-status:hover::after { +[data-dark-mode] body .copy-status:hover::after { content: "Copy"; display: block; color: $link-color-dark; } -body.dark .copy-status:focus::after, -body.dark .copy-status:active::after { +[data-dark-mode] body .copy-status:focus::after, +[data-dark-mode] body .copy-status:active::after { content: "Copied"; display: block; color: $link-color-dark; } + +/* +[data-dark-mode] body .dropdown-toggle:focus, +[data-dark-mode] body .doks-sidebar-toggle:focus { + box-shadow: 0 0 0 0.2rem $focus-color-dark; +} +*/ + +[data-dark-mode] body .offcanvas { + background-color: $body-bg-dark; +} + +[data-dark-mode] body .btn-close { + background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiNkZWUyZTYiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iZmVhdGhlciBmZWF0aGVyLXgiPjxsaW5lIHgxPSIxOCIgeTE9IjYiIHgyPSI2IiB5Mj0iMTgiPjwvbGluZT48bGluZSB4MT0iNiIgeTE9IjYiIHgyPSIxOCIgeTI9IjE4Ij48L2xpbmU+PC9zdmc+"); + background-size: 1.5rem; +} + +@include media-breakpoint-up(md) { + [data-dark-mode] body .alert-dismissible .btn-close { + background-size: 1.25rem; + } +} + +/* +[data-dark-mode] body .btn-close:focus { + box-shadow: 0 0 0 0.2rem $focus-color-dark; +} +*/ + +[data-dark-mode] .dropdown-item { + color: $body-bg-dark; +} + +[data-dark-mode] body hr.text-black-50 { + color: $gray-600 !important; +} + +[data-dark-mode] body .email-form .form-control { + background: $body-overlay-dark; + border: 1px solid transparent; +} + +[data-dark-mode] body .email-form .form-control:focus { + border: 1px solid $link-color-dark; +} + +[data-dark-mode] .page-link { + color: $link-color-dark; + background-color: transparent; + border: $pagination-border-width solid $border-dark; + + &:hover { + color: $body-bg-dark; + background-color: $body-color-dark; + border-color: $body-color-dark; + } + + &:focus { + color: $body-bg-dark; + background-color: $body-color-dark; + } +} + +[data-dark-mode] .page-item { + &.active .page-link { + color: $body-bg-dark; + + @include gradient-bg($link-color-dark); + + border-color: $link-color-dark; + } + + &.disabled .page-link { + color: $pagination-disabled-color; + background-color: $body-overlay-dark; + border-color: $border-dark; + } +} diff --git a/assets/scss/common/_global.scss b/assets/scss/common/_global.scss index ad45503..7e6c572 100644 --- a/assets/scss/common/_global.scss +++ b/assets/scss/common/_global.scss @@ -9,6 +9,10 @@ padding-bottom: 3rem; } +.content img { + max-width: 100%; +} + h1, h2, h3, @@ -24,10 +28,27 @@ h6, margin: 2rem 0 1rem; } +.offcanvas-header { + border-bottom: 1px solid $gray-300; + padding-top: 1.0625rem; + padding-bottom: 0.8125rem; +} + +h5.offcanvas-title { + margin: 0; +} + +body.docs { + padding-top: 0 !important; +} + @include media-breakpoint-up(md) { body { font-size: $font-size-md; + + /* padding-top: 4rem !important; + */ } h1, @@ -85,9 +106,11 @@ a.btn:focus { } */ +/* body { padding-top: 3.5625rem; } +*/ .docs-sidebar { order: 2; @@ -227,3 +250,23 @@ body { .katex { font-size: $font-size-md; } + +.card-bar { + border-top: 4px solid; + border-image-source: linear-gradient(90deg, $primary, #8ed6fb 50%, #d32e9d); + border-image-slice: 1; +} + +.modal-backdrop { + background-color: #fff; +} + +.modal-backdrop.show { + opacity: 0.7; +} + +@include media-breakpoint-up(md) { + .modal-backdrop.show { + opacity: 0; + } +} diff --git a/assets/scss/common/_variables.scss b/assets/scss/common/_variables.scss index eab8191..0baa1ec 100644 --- a/assets/scss/common/_variables.scss +++ b/assets/scss/common/_variables.scss @@ -20,6 +20,7 @@ $purple: #5d2f86; $brown: #aa9c84; $blue-300: #8ed6fb; +$pink-100: #fcfaff; $pink-500: #d32e9d; $primary: $purple; @@ -115,7 +116,7 @@ $font-size-lg: $font-size-base * 1.25; $font-size-md: $font-size-base * 1.125; $font-size-sm: $font-size-base * 0.875; -$line-height-base: 1.5; +// $line-height-base: 1.5; $headings-font-family: null; $headings-font-weight: 700; @@ -159,3 +160,30 @@ $alert-border-width: 0; $alert-bg-scale: 0; $alert-border-scale: 0; $alert-color-scale: 0; + +// docsearch +$dropdown-config: ( + main-color: $purple, + layout-type: normal, + layout-width: normal, + layout-alignment: align, + background-color: $white, + border-radius: 4, + border-width: 1, + border-color: $gray-200, + box-shadow: none, + branding-position: bottom, + spacing: normal, + include-desc: yes, + background-category-header: $white, + font-size: normal, + header-color: $black, + title-color: $black, + subtitle-color: $black, + text-color: $black, + highlight-color: $purple, + highlight-opacity: 0.1, + highlight-type: underline +); + +$input-btn-focus-width: 0; diff --git a/assets/scss/components/_alerts.scss b/assets/scss/components/_alerts.scss index ae6fbf7..bce819d 100644 --- a/assets/scss/components/_alerts.scss +++ b/assets/scss/components/_alerts.scss @@ -7,7 +7,7 @@ margin-right: 0.75rem; } -.docs .alert { +.docs main .alert { margin: 2rem -1.5rem; } @@ -62,6 +62,28 @@ text-decoration: none; } +.alert-dismissible .btn-close { + position: absolute; + + /* + top: 50%; + transform: translateY(-50%); + */ + top: 0.75rem; + right: 1rem; + z-index: 2; + padding: 0.625rem; + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-x'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E"); + background-size: 1.5rem; + filter: invert(1) grayscale(100%) brightness(200%); +} + +@include media-breakpoint-up(md) { + .alert-dismissible .btn-close { + background-size: 1.25rem; + } +} + .alert code { background: darken($beige, 5%); color: $black; diff --git a/assets/scss/components/_buttons.scss b/assets/scss/components/_buttons.scss index 713f819..5e8cb2f 100644 --- a/assets/scss/components/_buttons.scss +++ b/assets/scss/components/_buttons.scss @@ -4,7 +4,9 @@ } #mode { - margin-right: 1.25rem; + padding-right: 0.25rem; + padding-left: 0.25rem; + margin-right: -0.25rem; } .btn-link:focus { @@ -18,7 +20,8 @@ @include media-breakpoint-up(md) { #mode { - margin-right: 0.5rem; + margin-left: 1.125rem; + margin-right: -0.375rem; } .navbar .btn-link { @@ -42,11 +45,11 @@ body .toggle-light { display: none; } -body.dark .toggle-light { +[data-dark-mode] body .toggle-light { display: block; } -body.dark .toggle-dark { +[data-dark-mode] body .toggle-dark { display: none; } @@ -183,3 +186,35 @@ pre { .btn-toggle-nav a.active { color: $link-color; } + +.doks-navbar .dropdown-menu, +.doks-subnavbar .dropdown-menu { + font-size: 0.875rem; +} + +.doks-navbar .dropdown-item.current, +.doks-subnavbar .dropdown-item.current { + font-weight: 600; + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23292b2c' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e"); + background-repeat: no-repeat; + background-position: right 1rem top 0.6rem; + background-size: 0.75rem 0.75rem; +} + +.btn-close { + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-x'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E"); + background-size: 1.5rem; +} + +.offcanvas-header .btn-close { + margin-right: 0 !important; +} + +.dropdown-toggle::after { + display: none; +} + +.dropdown-caret { + margin-left: -0.1875rem; + margin-right: -0.3125rem; +} diff --git a/assets/scss/components/_code.scss b/assets/scss/components/_code.scss index eb0c0a0..84ad2bc 100644 --- a/assets/scss/components/_code.scss +++ b/assets/scss/components/_code.scss @@ -28,7 +28,7 @@ pre code { } .hljs { - padding: 1.25rem 1.5rem; + padding: 1.5rem !important; } @include media-breakpoint-down(sm) { diff --git a/assets/scss/components/_search.scss b/assets/scss/components/_search.scss index 3a70b2b..6beebf2 100644 --- a/assets/scss/components/_search.scss +++ b/assets/scss/components/_search.scss @@ -4,9 +4,10 @@ #suggestions { position: absolute; - right: 0; + left: 0; margin-top: 0.5rem; width: calc(100vw - 3rem); + z-index: $zindex-dropdown; } #suggestions a { @@ -53,7 +54,7 @@ @include media-breakpoint-up(sm) { #suggestions { - width: 30rem; + width: 31.125rem; } #suggestions a { diff --git a/assets/scss/components/_syntax.scss b/assets/scss/components/_syntax.scss index a439178..2be315d 100644 --- a/assets/scss/components/_syntax.scss +++ b/assets/scss/components/_syntax.scss @@ -44,19 +44,19 @@ Based on Ascetic by (c) Ivan Sagalaev font-style: italic; } -body.dark .hljs { +[data-dark-mode] body .hljs { background: $body-overlay-dark; color: $body-color-dark; } -body.dark .hljs-string, -body.dark .hljs-variable, -body.dark .hljs-template-variable, -body.dark .hljs-symbol, -body.dark .hljs-bullet, -body.dark .hljs-section, -body.dark .hljs-addition, -body.dark .hljs-attribute, -body.dark .hljs-link { +[data-dark-mode] body .hljs-string, +[data-dark-mode] body .hljs-variable, +[data-dark-mode] body .hljs-template-variable, +[data-dark-mode] body .hljs-symbol, +[data-dark-mode] body .hljs-bullet, +[data-dark-mode] body .hljs-section, +[data-dark-mode] body .hljs-addition, +[data-dark-mode] body .hljs-attribute, +[data-dark-mode] body .hljs-link { color: $blue-300; } diff --git a/assets/scss/layouts/_header.scss b/assets/scss/layouts/_header.scss index d9e7abd..cb85c32 100644 --- a/assets/scss/layouts/_header.scss +++ b/assets/scss/layouts/_header.scss @@ -14,6 +14,7 @@ font-weight: $headings-font-weight; } +/* .navbar-light .navbar-brand, .navbar-light .navbar-brand:hover, .navbar-light .navbar-brand:active { @@ -23,6 +24,23 @@ .navbar-light .navbar-nav .active .nav-link { color: $primary; } +*/ + +.navbar { + z-index: 1000; + background-color: rgba(255, 255, 255, 0.95); + border-bottom: 1px solid $gray-200; + + /* + margin-top: 4px; + */ +} + +@include media-breakpoint-up(lg) { + .navbar { + z-index: 1025; + } +} @include media-breakpoint-up(md) { .navbar-brand { @@ -39,7 +57,7 @@ } .nav-item { - margin-left: 1.25rem; + margin-left: 0; } @include media-breakpoint-up(md) { @@ -48,11 +66,13 @@ } } +/* @include media-breakpoint-down(sm) { .nav-item:first-child { margin-left: 0; } } +*/ @include media-breakpoint-down(md) { .navbar .container { @@ -66,11 +86,49 @@ height: 0; } +button#doks-languages { + margin-right: -0.5625rem; + margin-left: 0.75rem; +} + +button#doks-versions { + margin-right: -0.5625rem; + margin-left: 0; +} + +.offcanvas .nav-link { + color: $body-color; +} + +.doks-subnavbar { + background-color: rgba(255, 255, 255, 0.95); + border-bottom: 1px solid $gray-200; +} + +.doks-subnavbar .nav-link { + padding: 0.5rem 1.5rem 0.5rem 0; +} + +.doks-subnavbar .nav-link:first-child { + padding: 0.5rem 1.5rem 0.5rem 0; +} + +.offcanvas .nav-link:hover, +.offcanvas .nav-link:focus { + color: $link-color; +} + +.offcanvas .nav-link.active { + color: $link-color; +} + +/* .navbar { background-color: rgba(255, 255, 255, 0.95); border-bottom: 1px solid $gray-200; margin-top: 4px; } +*/ .header-bar { border-top: 4px solid; @@ -78,18 +136,24 @@ border-image-slice: 1; } +.offcanvas .header-bar { + margin-bottom: -4px; +} + .home .navbar { border-bottom: 0; } +/* .navbar-form { position: relative; margin-top: 0.25rem; } +*/ @include media-breakpoint-up(md) { .navbar-brand { - margin-right: 1rem !important; + margin-right: 0.75rem !important; } .main-nav .nav-item:first-child .nav-link, @@ -102,13 +166,49 @@ padding-right: 0; } + .doks-search { + max-width: 20rem; + margin-top: 0.125rem; + margin-bottom: 0.125rem; + } + + /* .navbar-form { margin-top: 0; margin-left: 6rem; margin-right: 1.5rem; } + */ } +.form-control.is-search { + padding-right: 4rem; + border: 1px solid transparent; + background: $gray-100; +} + +.form-control.is-search:focus { + border: 1px solid $primary; +} + +.doks-search::after { + position: absolute; + top: 0.4625rem; + right: 0.5375rem; + display: flex; + align-items: center; + justify-content: center; + height: 1.5rem; + padding-right: 0.3125rem; + padding-left: 0.3125rem; + font-size: $font-size-base * 0.75; + color: $gray-700; + content: "Ctrl + /"; + border: 1px solid $gray-300; + border-radius: 0.25rem; +} + +/* @include media-breakpoint-up(lg) { .navbar-form { margin-left: 15rem; @@ -120,23 +220,34 @@ margin-left: 30rem; } } +*/ +/* .form-control.is-search { - /* +*/ + +/* padding-right: calc(1.5em + 0.75rem); */ + +/* padding-right: 2.5rem; background: $gray-100; border: 0; + */ - /* +/* background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-search'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right calc(0.375em + 0.1875rem) center; background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem); */ -} +/* +} +*/ + +/* .navbar-form::after { position: absolute; top: 0.4625rem; @@ -153,6 +264,7 @@ border: 1px solid $gray-300; border-radius: 0.25rem; } +*/ /*! purgecss start ignore */ .algolia-autocomplete { @@ -170,12 +282,20 @@ width: auto !important; } + .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--subcategory-column { + font-weight: normal; + } + .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--subcategory-column::after { - content: "|"; + content: "/"; margin-right: 0.25rem; } } +.algolia-autocomplete .algolia-docsearch-suggestion--category-header { + color: $black; +} + .algolia-autocomplete .algolia-docsearch-suggestion--title { margin-bottom: 0; } @@ -266,3 +386,60 @@ .navbar .menu-btn:checked ~ .menu-icon:not(.steps) .navicon::after { top: 0; } + +.btn-menu { + margin-left: 1rem; +} + +.btn-menu, +.doks-sidebar-toggle { + padding-right: 0.25rem; + padding-left: 0.25rem; + margin-right: -0.5rem; +} + +.btn-menu:hover, +.btn-doks-light:hover, +.doks-sidebar-toggle:hover { + background: $pink-100; +} + +.btn-menu:focus, +.doks-sidebar-toggle:focus, +.doks-mode-toggle:focus { + outline: 0; +} + +.doks-sidebar-toggle .doks-collapse { + display: none; +} + +.doks-sidebar-toggle:not(.collapsed) .doks-expand { + display: none; +} + +.doks-sidebar-toggle:not(.collapsed) .doks-collapse { + display: inline-block; +} + +.navbar-light .navbar-brand, +.navbar-light .navbar-brand:hover, +.navbar-light .navbar-brand:active { + color: $body-color; +} + +.navbar-light .navbar-nav .active .nav-link { + color: $primary; +} + +.dropdown-divider { + border-top: 1px dashed $gray-200; +} + +.dropdown-item:hover { + background: $gray-100; +} + +.dropdown-item:active { + color: inherit; +} diff --git a/assets/scss/layouts/_pages.scss b/assets/scss/layouts/_pages.scss index 8938dbc..2810268 100644 --- a/assets/scss/layouts/_pages.scss +++ b/assets/scss/layouts/_pages.scss @@ -43,3 +43,7 @@ p.meta { margin-top: 2.25rem; font-size: $font-size-base; } + +.page-link:hover { + text-decoration: none; +} diff --git a/config/_default/config.toml b/config/_default/config.toml index 56fc5c8..df71fa9 100644 --- a/config/_default/config.toml +++ b/config/_default/config.toml @@ -1,4 +1,4 @@ -baseurl = "/" +baseurl = "https://doks.netlify.app/" canonifyURLs = false disableAliases = true disableHugoGeneratorInject = true @@ -9,6 +9,11 @@ languageCode = "en-US" paginate = 7 rssLimit = 10 +# Multilingual +defaultContentLanguage = "en" +disableLanguages = ["de", "nl"] +# defaultContentLanguageInSubdir = true + # add redirects/headers [outputs] home = ["HTML", "RSS", "REDIRECTS", "HEADERS"] @@ -42,28 +47,10 @@ isPlainText = true noUgly = true rel = "sitemap" -[markup] - [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] - codeFences = false - guessSyntax = false - hl_Lines = "" - lineNoStart = 1 - lineNos = false - lineNumbersInTable = true - noClasses = false - style = "dracula" - tabWidth = 4 +[caches] + [caches.getjson] + dir = ":cacheDir/:project" + maxAge = "10s" [sitemap] changefreq = "weekly" @@ -75,6 +62,10 @@ rel = "sitemap" [permalinks] blog = "/blog/:title/" +# docs = "/docs/1.0/:sections[1:]/:title/" + +[minify.tdewolff.html] + keepWhitespace = false [module] [module.hugoVersion] diff --git a/config/_default/languages.toml b/config/_default/languages.toml new file mode 100644 index 0000000..1f0ca3e --- /dev/null +++ b/config/_default/languages.toml @@ -0,0 +1,25 @@ +[en] + languageName = "English" + contentDir = "content/en" + weight = 10 + [en.params] + languageISO = "EN" + +[de] + languageName = "German" + contentDir = "content/de" + weight = 15 + [de.params] + languageISO = "DE" + +[nl] + languageName = "Nederlands" + contentDir = "content/nl" + weight = 20 + [nl.params] + languageISO = "NL" + titleAddition = "Modern documentatie-thema" + description = "Doks is een Hugo-thema waarmee je moderne documentatie-websites kunt bouwen die veilig, snel en klaar voor SEO zijn — standaard." + titleHome = "Doks thema" + footer = "Mogelijk gemaakt door Netlify, Hugo, en Doks" + alertText = "Introductie van het Doks-kinderthema, verschillende DX + UX-updates en meer! Bekijk Doks v0.2" diff --git a/config/_default/markup.toml b/config/_default/markup.toml new file mode 100644 index 0000000..2880e30 --- /dev/null +++ b/config/_default/markup.toml @@ -0,0 +1,29 @@ +defaultMarkdownHandler = "goldmark" + +[goldmark] + [goldmark.extensions] + linkify = false + [goldmark.parser] + autoHeadingID = true + autoHeadingIDType = "github" + [goldmark.parser.attribute] + block = true + title = true + [goldmark.renderer] + unsafe = true + +[highlight] + codeFences = false + guessSyntax = false + hl_Lines = "" + lineNoStart = 1 + lineNos = false + lineNumbersInTable = true + noClasses = false + style = "dracula" + tabWidth = 4 + +[tableOfContents] + endLevel = 3 + ordered = false + startLevel = 2 diff --git a/config/_default/menus.toml b/config/_default/menus/menus.en.toml similarity index 97% rename from config/_default/menus.toml rename to config/_default/menus/menus.en.toml index 7ed4bca..935d480 100644 --- a/config/_default/menus.toml +++ b/config/_default/menus/menus.en.toml @@ -13,6 +13,7 @@ [[main]] name = "Docs" url = "/docs/prologue/introduction/" +# url = "/docs/1.0/prologue/introduction/" weight = 10 [[main]] @@ -20,17 +21,17 @@ url = "/blog/" weight = 20 -[[social]] - name = "Twitter" - pre = "" - url = "https://twitter.com/getdoks" - weight = 10 - [[social]] name = "GitHub" pre = "" url = "https://github.com/h-enk/doks" post = "v0.1.0" + weight = 10 + +[[social]] + name = "Twitter" + pre = "" + url = "https://twitter.com/getdoks" weight = 20 # [[footer]] diff --git a/config/_default/menus/menus.nl.toml b/config/_default/menus/menus.nl.toml new file mode 100644 index 0000000..e530352 --- /dev/null +++ b/config/_default/menus/menus.nl.toml @@ -0,0 +1,39 @@ +[[docs]] + name = "Prologue" + weight = 10 + identifier = "prologue" + url = "/docs/prologue/" + +[[docs]] + name = "Help" + weight = 60 + identifier = "help" + url = "/docs/help/" + +[[main]] + name = "Docs" + url = "/docs/prologue/introduction/" + weight = 10 + +# [[main]] +# name = "Blog" +# url = "/blog/" +# weight = 20 + +[[social]] + name = "GitHub" + pre = "" + url = "https://github.com/h-enk/doks" + post = "v0.1.0" + weight = 10 + +[[social]] + name = "Twitter" + pre = "" + url = "https://twitter.com/getdoks" + weight = 20 + +# [[footer]] +# name = "Privacy" +# url = "/privacy-policy/" +# weight = 10 diff --git a/config/_default/params.toml b/config/_default/params.toml index 9601055..fec8c77 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -4,7 +4,10 @@ title = "Doks" titleSeparator = "-" titleAddition = "Modern Documentation Theme" -description = "Doks is a Hugo theme helping you build modern documentation websites that are secure, fast, and SEO-ready — by default." +description = "Doks is a Hugo theme for building secure, fast, and SEO-ready documentation websites, which you can easily update and customize." + +## Documentation +# docsVersion = "0.3" ## Open Graph images = ["doks.png"] @@ -48,17 +51,23 @@ bgColor = "#fff" landscapePhotoWidths = [900, 800, 700, 600, 500] portraitPhotoWidths = [800, 700, 600, 500] lqipWidth = "20x" +smallLimit = "300" # Footer footer = "Powered by Netlify, Hugo, and Doks" + +# Feed copyRight = "Copyright (c) 2020-2021 Henk Verlinde" # Alert alert = false -alertText = "Like Doks? Star on GitHub. Thanks!" +alertDismissable = true +# alertText = "Introducing the Doks child theme, several DX + UX updates, and more! Check out Doks v0.2" +alertText = "Introducing the Doks child theme, several DX + UX updates, and more! Check out Doks v0.2" # Edit Page docsRepo = "https://github.com/h-enk/doks" +docsRepoBranch = "master" editPage = false [options] @@ -71,4 +80,6 @@ editPage = false breadCrumb = false highLight = true kaTex = false - collapsibleSidebar = false + collapsibleSidebar = true + multilingualMode = false + docsVersioning = false diff --git a/config/next/config.toml b/config/next/config.toml index bf4bbcd..9c5e90d 100644 --- a/config/next/config.toml +++ b/config/next/config.toml @@ -1,2 +1 @@ -baseurl = "https://doks-next.netlify.app/" -canonifyURLs = true +canonifyURLs = false diff --git a/config/postcss.config.js b/config/postcss.config.js index d5edc25..b6891e2 100644 --- a/config/postcss.config.js +++ b/config/postcss.config.js @@ -27,6 +27,7 @@ module.exports = { './assets/scss/components/_syntax.scss', './assets/scss/components/_search.scss', './assets/scss/common/_dark.scss', + './node_modules/bootstrap/scss/_dropdown.scss', './node_modules/katex/dist/katex.css', ]), ], diff --git a/config/production/config.toml b/config/production/config.toml index c4ca660..9c5e90d 100644 --- a/config/production/config.toml +++ b/config/production/config.toml @@ -1,2 +1 @@ -baseurl = "https://doks.netlify.app/" -canonifyURLs = true +canonifyURLs = false diff --git a/content/_index.md b/content/_index.md deleted file mode 100644 index db4b8c4..0000000 --- a/content/_index.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title : "Modern Documentation Theme" -description: "Doks is a Hugo theme helping you build modern documentation websites that are secure, fast, and SEO-ready — by default." -lead: "Doks is a Hugo theme helping you build modern documentation websites that are secure, fast, and SEO-ready — by default." -date: 2020-10-06T08:47:36+00:00 -lastmod: 2020-10-06T08:47:36+00:00 -draft: false -images: [] ---- diff --git a/content/en/_index.md b/content/en/_index.md new file mode 100644 index 0000000..2e514e8 --- /dev/null +++ b/content/en/_index.md @@ -0,0 +1,9 @@ +--- +title : "Modern Documentation Theme" +description: "Doks is a Hugo theme for building secure, fast, and SEO-ready documentation websites, which you can easily update and customize." +lead: "Doks is a Hugo theme for building secure, fast, and SEO-ready documentation websites, which you can easily update and customize." +date: 2020-10-06T08:47:36+00:00 +lastmod: 2020-10-06T08:47:36+00:00 +draft: false +images: [] +--- diff --git a/content/blog/_index.md b/content/en/blog/_index.md similarity index 100% rename from content/blog/_index.md rename to content/en/blog/_index.md diff --git a/content/blog/say-hello-to-doks/index.md b/content/en/blog/say-hello-to-doks/index.md similarity index 100% rename from content/blog/say-hello-to-doks/index.md rename to content/en/blog/say-hello-to-doks/index.md diff --git a/content/blog/say-hello-to-doks/say-hello-to-doks.png b/content/en/blog/say-hello-to-doks/say-hello-to-doks.png similarity index 100% rename from content/blog/say-hello-to-doks/say-hello-to-doks.png rename to content/en/blog/say-hello-to-doks/say-hello-to-doks.png diff --git a/content/contact/index.md b/content/en/contact/index.md similarity index 100% rename from content/contact/index.md rename to content/en/contact/index.md diff --git a/content/contributors/_index.md b/content/en/contributors/_index.md similarity index 100% rename from content/contributors/_index.md rename to content/en/contributors/_index.md diff --git a/content/contributors/henk-verlinde/_index.md b/content/en/contributors/henk-verlinde/_index.md similarity index 100% rename from content/contributors/henk-verlinde/_index.md rename to content/en/contributors/henk-verlinde/_index.md diff --git a/content/docs/_index.md b/content/en/docs/_index.md similarity index 100% rename from content/docs/_index.md rename to content/en/docs/_index.md diff --git a/content/docs/help/_index.md b/content/en/docs/help/_index.md similarity index 100% rename from content/docs/help/_index.md rename to content/en/docs/help/_index.md diff --git a/content/docs/help/faq.md b/content/en/docs/help/faq.md similarity index 98% rename from content/docs/help/faq.md rename to content/en/docs/help/faq.md index 826586b..f0c3bb4 100644 --- a/content/docs/help/faq.md +++ b/content/en/docs/help/faq.md @@ -23,7 +23,7 @@ Please keep it in place. ## Keyboard shortcuts for search? -- focus: `/` +- focus: `Ctrl + /` - select: `↓` and `↑` - open: `Enter` - close: `Esc` diff --git a/content/docs/help/how-to-update.md b/content/en/docs/help/how-to-update.md similarity index 100% rename from content/docs/help/how-to-update.md rename to content/en/docs/help/how-to-update.md diff --git a/content/docs/help/troubleshooting.md b/content/en/docs/help/troubleshooting.md similarity index 100% rename from content/docs/help/troubleshooting.md rename to content/en/docs/help/troubleshooting.md diff --git a/content/docs/prologue/_index.md b/content/en/docs/prologue/_index.md similarity index 100% rename from content/docs/prologue/_index.md rename to content/en/docs/prologue/_index.md diff --git a/content/docs/prologue/commands.md b/content/en/docs/prologue/commands.md similarity index 100% rename from content/docs/prologue/commands.md rename to content/en/docs/prologue/commands.md diff --git a/content/en/docs/prologue/introduction.md b/content/en/docs/prologue/introduction.md new file mode 100644 index 0000000..53a7ed1 --- /dev/null +++ b/content/en/docs/prologue/introduction.md @@ -0,0 +1,58 @@ +--- +title: "Introduction" +description: "Doks is a Hugo theme for building secure, fast, and SEO-ready documentation websites, which you can easily update and customize." +lead: "Doks is a Hugo theme for building secure, fast, and SEO-ready documentation websites, which you can easily update and customize." +date: 2020-10-06T08:48:57+00:00 +lastmod: 2020-10-06T08:48:57+00:00 +draft: false +images: [] +menu: + docs: + parent: "prologue" +weight: 100 +toc: true +--- + +## Get started + +There are two main ways to get started with Doks: + +### Tutorial + +{{< alert icon="👉" text="The Tutorial is intended for novice to intermediate users." />}} + +Step-by-step instructions on how to start a new Doks project. [Tutorial →](https://getdoks.org/tutorial/introduction/) + +### Quick Start + +{{< alert icon="👉" text="The Quick Start is intended for intermediate to advanced users." />}} + +One page summary of how to start a new Doks project. [Quick Start →]({{< relref "quick-start" >}}) + +## Go further + +Recipes, Reference Guides, Extensions, and Showcase. + +### Recipes + +Get instructions on how to accomplish common tasks with Doks. [Recipes →](https://getdoks.org/docs/recipes/project-configuration/) + +### Reference Guides + +Learn how to customize Doks to fully make it your own. [Reference Guides →](https://getdoks.org/docs/reference-guides/security/) + +### Extensions + +Get instructions on how to add even more to Doks. [Extensions →](https://getdoks.org/docs/extensions/breadcrumb-navigation/) + +### Showcase + +See what others have build with Doks. [Showcase →](https://getdoks.org/showcase/electric-blocks/) + +## Contributing + +Find out how to contribute to Doks. [Contributing →](https://getdoks.org/docs/contributing/how-to-contribute/) + +## Help + +Get help on Doks. [Help →]({{< relref "how-to-update" >}}) diff --git a/content/docs/prologue/quick-start.md b/content/en/docs/prologue/quick-start.md similarity index 100% rename from content/docs/prologue/quick-start.md rename to content/en/docs/prologue/quick-start.md diff --git a/content/privacy-policy/index.md b/content/en/privacy-policy/index.md similarity index 100% rename from content/privacy-policy/index.md rename to content/en/privacy-policy/index.md diff --git a/content/en/versions.md b/content/en/versions.md new file mode 100644 index 0000000..ddbe002 --- /dev/null +++ b/content/en/versions.md @@ -0,0 +1,11 @@ +--- +title: "Versions" +description: "" +lead: "An appendix of hosted documentation for nearly every release of Doks, from v0 through v3." +date: 2021-09-24T08:50:23+02:00 +lastmod: 2021-09-24T08:50:23+02:00 +draft: true +images: [] +layout: versions +url: "/docs/versions/" +--- diff --git a/content/nl/_index.md b/content/nl/_index.md new file mode 100644 index 0000000..58c6b69 --- /dev/null +++ b/content/nl/_index.md @@ -0,0 +1,10 @@ +--- +title : "Modern documentatie-thema" +description: "Doks is een Hugo-thema waarmee je moderne documentatie-websites kunt bouwen die veilig, snel en klaar voor SEO zijn — standaard." +lead: "Doks is een Hugo-thema waarmee je moderne documentatie-websites kunt bouwen die veilig, snel en klaar voor SEO zijn — standaard." +date: 2020-10-06T08:47:36+00:00 +lastmod: 2020-10-06T08:47:36+00:00 +draft: false +images: [] +--- + diff --git a/content/nl/contact/index.md b/content/nl/contact/index.md new file mode 100644 index 0000000..795089f --- /dev/null +++ b/content/nl/contact/index.md @@ -0,0 +1,10 @@ +--- +title: "Contact" +description: "Drop us an email." +date: 2020-08-27T19:25:12+02:00 +lastmod: 2020-08-27T19:25:12+02:00 +draft: true +images: [] +--- + +{{< email user="hello" domain="getdoks.org" >}} diff --git a/content/nl/contributors/_index.md b/content/nl/contributors/_index.md new file mode 100644 index 0000000..e225f34 --- /dev/null +++ b/content/nl/contributors/_index.md @@ -0,0 +1,10 @@ +--- +title: "Contributors" +description: "The Doks contributors." +date: 2020-10-06T08:50:29+00:00 +lastmod: 2020-10-06T08:50:29+00:00 +draft: false +images: [] +--- + +The Doks contributors. diff --git a/content/nl/contributors/henk-verlinde/_index.md b/content/nl/contributors/henk-verlinde/_index.md new file mode 100644 index 0000000..f775534 --- /dev/null +++ b/content/nl/contributors/henk-verlinde/_index.md @@ -0,0 +1,12 @@ +--- +title: "Henk Verlinde" +description: "Creator of Hyas." +date: 2020-10-06T08:50:45+00:00 +lastmod: 2020-10-06T08:50:45+00:00 +draft: false +images: [] +--- + +Creator of Hyas. + +[@HenkVerlinde](https://twitter.com/henkverlinde) diff --git a/content/nl/docs/_index.md b/content/nl/docs/_index.md new file mode 100644 index 0000000..f807c65 --- /dev/null +++ b/content/nl/docs/_index.md @@ -0,0 +1,9 @@ +--- +title : "Docs" +description: "Docs Doks." +lead: "" +date: 2020-10-06T08:48:23+00:00 +lastmod: 2020-10-06T08:48:23+00:00 +draft: false +images: [] +--- diff --git a/content/nl/docs/help/_index.md b/content/nl/docs/help/_index.md new file mode 100644 index 0000000..bc503ec --- /dev/null +++ b/content/nl/docs/help/_index.md @@ -0,0 +1,9 @@ +--- +title: "Help" +description: "Help Doks." +lead: "" +date: 2020-10-06T08:49:15+00:00 +lastmod: 2020-10-06T08:49:15+00:00 +draft: false +images: [] +--- diff --git a/content/nl/docs/help/faq.md b/content/nl/docs/help/faq.md new file mode 100644 index 0000000..f0c3bb4 --- /dev/null +++ b/content/nl/docs/help/faq.md @@ -0,0 +1,50 @@ +--- +title: "FAQ" +description: "Answers to frequently asked questions." +lead: "Answers to frequently asked questions." +date: 2020-10-06T08:49:31+00:00 +lastmod: 2020-10-06T08:49:31+00:00 +draft: false +images: [] +menu: + docs: + parent: "help" +weight: 630 +toc: true +--- + +## Hyas? + +Doks is a [Hyas theme](https://gethyas.com/themes/) build by the creator of Hyas. + +## Footer notice? + +Please keep it in place. + +## Keyboard shortcuts for search? + +- focus: `Ctrl + /` +- select: `↓` and `↑` +- open: `Enter` +- close: `Esc` + +## Other documentation? + +- [Netlify](https://docs.netlify.com/) +- [Hugo](https://gohugo.io/documentation/) + +## Can I get support? + +Create a topic: + +- [Netlify Community](https://community.netlify.com/) +- [Hugo Forums](https://discourse.gohugo.io/) +- [Doks Discussions](https://github.com/h-enk/doks/discussions) + +## Contact the creator? + +Send `h-enk` a message: + +- [Netlify Community](https://community.netlify.com/) +- [Hugo Forums](https://discourse.gohugo.io/) +- [Doks Discussions](https://github.com/h-enk/doks/discussions) diff --git a/content/nl/docs/help/how-to-update.md b/content/nl/docs/help/how-to-update.md new file mode 100644 index 0000000..f9bb36b --- /dev/null +++ b/content/nl/docs/help/how-to-update.md @@ -0,0 +1,32 @@ +--- +title: "How to Update" +description: "Regularly update the installed npm packages to keep your Doks website stable, usable, and secure." +lead: "Regularly update the installed npm packages to keep your Doks website stable, usable, and secure." +date: 2020-11-12T13:26:54+01:00 +lastmod: 2020-11-12T13:26:54+01:00 +draft: false +images: [] +menu: + docs: + parent: "help" +weight: 610 +toc: true +--- + +{{< alert icon="💡" text="Learn more about semantic versioning and advanced range syntax." />}} + +## Check for outdated packages + +The [`npm outdated`](https://docs.npmjs.com/cli/v7/commands/npm-outdated) command will check the registry to see if any (or, specific) installed packages are currently outdated: + +```bash +npm outdated [[<@scope>/] ...] +``` + +## Update packages + +The [`npm update`](https://docs.npmjs.com/cli/v7/commands/npm-update) command will update all the packages listed to the latest version (specified by the tag config), respecting semver: + +```bash +npm update [...] +``` diff --git a/content/nl/docs/help/troubleshooting.md b/content/nl/docs/help/troubleshooting.md new file mode 100644 index 0000000..0d52dbb --- /dev/null +++ b/content/nl/docs/help/troubleshooting.md @@ -0,0 +1,30 @@ +--- +title: "Troubleshooting" +description: "Solutions to common problems." +lead: "Solutions to common problems." +date: 2020-11-12T15:22:20+01:00 +lastmod: 2020-11-12T15:22:20+01:00 +draft: false +images: [] +menu: + docs: + parent: "help" +weight: 620 +toc: true +--- + +## Problems updating npm packages + +Delete the `./node_modules` folder, and run again: + +```bash +npm install +``` + +## Problems with cache + +Delete the temporary directories: + +```bash +npm run clean +``` diff --git a/content/nl/docs/prologue/_index.md b/content/nl/docs/prologue/_index.md new file mode 100644 index 0000000..c3c1c40 --- /dev/null +++ b/content/nl/docs/prologue/_index.md @@ -0,0 +1,9 @@ +--- +title : "Prologue" +description: "Prologue Doks." +lead: "" +date: 2020-10-06T08:48:45+00:00 +lastmod: 2020-10-06T08:48:45+00:00 +draft: false +images: [] +--- diff --git a/content/nl/docs/prologue/commands.md b/content/nl/docs/prologue/commands.md new file mode 100644 index 0000000..e647a98 --- /dev/null +++ b/content/nl/docs/prologue/commands.md @@ -0,0 +1,98 @@ +--- +title: "Commands" +description: "Doks comes with commands for common tasks." +lead: "Doks comes with commands for common tasks." +date: 2020-10-13T15:21:01+02:00 +lastmod: 2020-10-13T15:21:01+02:00 +draft: false +images: [] +menu: + docs: + parent: "prologue" +weight: 130 +toc: true +--- + +{{< alert icon="💡" text="You can change the commands in the scripts section of `./package.json`." />}} + +## create + +Create new content for your site: + +```bash +npm run create [path] [flags] +``` + +See also the Hugo docs: [hugo new](https://gohugo.io/commands/hugo_new/). + +## lint + +Check scripts, styles, and markdown for errors: + +```bash +npm run lint +``` + +### scripts + +Check scripts for errors: + +```bash +npm run lint:scripts [-- --fix] +``` + +### styles + +Check styles for errors: + +```bash +npm run lint:styles [-- --fix] +``` + +### markdown + +Check markdown for errors: + +```bash +npm run lint:markdown [-- --fix] +``` + +## clean + +Delete temporary directories: + +```bash +npm run clean +``` + +## start + +Start local development server: + +```bash +npm run start +``` + +## build + +Build production website: + +```bash +npm run build +``` + +### functions + +Build Lambda functions: + +```bash +npm run build:functions +``` + +### preview + +Build production website including draft and future content: + +```bash +npm run build:preview +``` diff --git a/content/docs/prologue/introduction.md b/content/nl/docs/prologue/introduction.md similarity index 100% rename from content/docs/prologue/introduction.md rename to content/nl/docs/prologue/introduction.md diff --git a/content/nl/docs/prologue/quick-start.md b/content/nl/docs/prologue/quick-start.md new file mode 100644 index 0000000..9282d3e --- /dev/null +++ b/content/nl/docs/prologue/quick-start.md @@ -0,0 +1,69 @@ +--- +title: "Quick Start" +description: "One page summary of how to start a new Doks project." +lead: "One page summary of how to start a new Doks project." +date: 2020-11-16T13:59:39+01:00 +lastmod: 2020-11-16T13:59:39+01:00 +draft: false +images: [] +menu: + docs: + parent: "prologue" +weight: 110 +toc: true +--- + +## Requirements + +Doks uses npm to centralize dependency management, making it [easy to update]({{< relref "how-to-update" >}}) resources, build tooling, plugins, and build scripts: + +- Download and install [Node.js](https://nodejs.org/) (it includes npm) for your platform. + +## Start a new Doks project + +Create a new site, change directories, install dependencies, and start development server. + +### Create a new site + +Doks is available as a child theme, and a starter theme: + +- Use the Doks child theme, if you do __not__ plan to customize a lot, and/or need future Doks updates. +- Use the Doks starter theme, if you plan to customize a lot, and/or do __not__ need future Doks updates. + +Not quite sure? Use the Doks child theme. + +#### Doks child theme + +```bash +git clone https://github.com/h-enk/doks-child-theme.git my-doks-site +``` + +#### Doks starter theme + +```bash +git clone https://github.com/h-enk/doks.git my-doks-site +``` + +### Change directories + +```bash +cd my-doks-site +``` + +### Install dependencies + +```bash +npm install +``` + +### Start development server + +```bash +npm run start +``` + +Doks will start the Hugo development webserver accessible by default at `http://localhost:1313`. Saved changes will live reload in the browser. + +## Other commands + +Doks comes with commands for common tasks. [Commands →]({{< relref "commands" >}}) diff --git a/content/nl/privacy-policy/index.md b/content/nl/privacy-policy/index.md new file mode 100644 index 0000000..6315024 --- /dev/null +++ b/content/nl/privacy-policy/index.md @@ -0,0 +1,36 @@ +--- +title: "Privacy Policy" +description: "We do not use cookies and we do not collect any personal data." +date: 2020-08-27T19:23:18+02:00 +lastmod: 2020-08-27T19:23:18+02:00 +draft: true +images: [] +--- + +__TLDR__: We do not use cookies and we do not collect any personal data. + +## Website visitors + +- No personal information is collected. +- No information is stored in the browser. +- No information is shared with, sent to or sold to third-parties. +- No information is shared with advertising companies. +- No information is mined and harvested for personal and behavioral trends. +- No information is monetized. + +### Information we collect and what we use it for + +We run [Plausible](https://plausible.io/) analytics on getdoks.org. The following information is collected: + +- __Page URL__. We track the page URL of each page view on this website. We use this to understand which pages have been viewed and how many times a particular page has been viewed. For example: _https://getdoks.org/_. +- __HTTP Referrer__. We use the referrer string to understand the number of visitors referred to this website from links on other sites. For example: _https://github.com/_. +- __Browser__. We use this to understand what browsers people use when visiting this website. This is derived from the User-Agent HTTP header. The full User-Agent is discarded. For example: _Chrome_. +- __Operating system__. We use this to understand what operating systems people use when visiting this website. We only use the brand of the operating system and don’t include the version number or any other details. This is derived from the User-Agent HTTP header. The full User-Agent is discarded. For example: _GNU/Linux_. +- __Device type__. We use this to understand what devices people use when visiting this website. This is derived from window.innerWidth. The actual width of the browser in pixels is discarded. For example: _Desktop_. +- __Visitor Country__. We look up the visitor’s country using the IP address. We do not track anything more granular than the country of origin and the IP address of the visitor is discarded. We never store IP addresses in our database or logs. For example: _Canada_. + +## Contact us + +[Contact us]({{< relref "contact/index.md" >}}) if you have any questions. + +Effective Date: _27th August 2020_ diff --git a/data/.gitkeep b/data/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/data/docs-versions.yml b/data/docs-versions.yml new file mode 100644 index 0000000..8e7e5dd --- /dev/null +++ b/data/docs-versions.yml @@ -0,0 +1,60 @@ +# - group: v1.x +# baseurl: "https://getbootstrap.com" +# description: "Every minor and patch release from v1 is listed below." +# versions: +# - v: "1.0.0" +# - v: "1.1.0" +# - v: "1.1.1" +# - v: "1.2.0" +# - v: "1.3.0" +# - v: "1.4.0" +# +# - group: v2.x +# baseurl: "https://getbootstrap.com" +# description: "Every minor and patch release from v2 is listed below." +# versions: +# - v: "2.0.0" +# - v: "2.0.1" +# - v: "2.0.2" +# - v: "2.0.3" +# - v: "2.0.4" +# - v: "2.1.0" +# - v: "2.1.1" +# - v: "2.2.0" +# - v: "2.2.1" +# - v: "2.2.2" +# - v: "2.3.0" +# - v: "2.3.1" +# - v: "2.3.2" +# +# - group: v3.x +# baseurl: "https://getbootstrap.com/docs" +# description: "Every minor and patch release from v3 is listed below. Last update was v3.4.1." +# versions: +# - v: "3.3" +# - v: "3.4" +# +# - group: v4.x +# baseurl: "https://getbootstrap.com/docs" +# description: "Our previous major release with its minor releases. Last update was v4.6.0." +# versions: +# - v: "4.0" +# - v: "4.1" +# - v: "4.2" +# - v: "4.3" +# - v: "4.4" +# - v: "4.5" +# - v: "4.6" + +- group: v0.x + baseurl: "/docs" + description: "Current major release. Last update was v0.2.0." + versions: + - v: "0.1" + - v: "0.2" + +- group: v1.x + baseurl: "/docs" + description: "Every minor and patch release from v1 is listed below. Last update was v1.0.0." + versions: + - v: "1.0" diff --git a/i18n/en.toml b/i18n/en.toml new file mode 100644 index 0000000..cb52685 --- /dev/null +++ b/i18n/en.toml @@ -0,0 +1,2 @@ +[get-started] + other = "Get Started" \ No newline at end of file diff --git a/i18n/nl.toml b/i18n/nl.toml new file mode 100644 index 0000000..f80323e --- /dev/null +++ b/i18n/nl.toml @@ -0,0 +1,2 @@ +[get-started] + other = "Aan de slag" \ No newline at end of file diff --git a/images/screenshot.png b/images/screenshot.png index 5849cbb..072753b 100644 Binary files a/images/screenshot.png and b/images/screenshot.png differ diff --git a/images/tn.png b/images/tn.png index e51da8e..ff29c68 100644 Binary files a/images/tn.png and b/images/tn.png differ diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html new file mode 100644 index 0000000..18e7a3c --- /dev/null +++ b/layouts/_default/_markup/render-image.html @@ -0,0 +1,27 @@ +{{ $image := .Page.Resources.GetMatch .Destination -}} +{{ $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 ",") -}} + +{{ if gt $image.Width site.Params.smallLimit -}} +

+ {{ $.Text }} + + {{ with $.Title }}
{{ . | safeHTML }}
{{ end -}} +
+{{ else -}} + {{ $.Text }} +{{ end -}} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index e5b2257..887373d 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -14,7 +14,7 @@ {{ end -}} {{ partial "header/header.html" . }} -
+
{{ block "main" . }}{{ end }}
@@ -22,9 +22,6 @@ {{ block "sidebar-prefooter" . }}{{ end }} {{ block "sidebar-footer" . }}{{ end }} {{ partial "footer/footer.html" . }} - {{ if and .IsHome .Site.Params.alert }} - {{ partial "footer/alert.html" . }} - {{ end }} {{ partial "footer/script-footer.html" . }} \ No newline at end of file diff --git a/layouts/_default/versions.html b/layouts/_default/versions.html new file mode 100644 index 0000000..3101b82 --- /dev/null +++ b/layouts/_default/versions.html @@ -0,0 +1,27 @@ +{{ define "main" }} +
+

{{ .Title }}

+

{{ .Params.lead | safeHTML }}

+ {{ .Content }} +
+ {{ range $release := sort (index $.Site.Data "docs-versions") "group" "desc" -}} +
+

{{ $release.group }}

+

{{ $release.description }}

+ {{ $versions := sort $release.versions "v" "desc" -}} + {{ range $i, $version := $versions -}} + {{ $len := len $versions -}} + {{ if (eq $i 0) }}{{ end }} + {{ end -}} +
+ {{ end -}} +
+
+{{ end }} diff --git a/layouts/blog/list.html b/layouts/blog/list.html index a268ca5..9695387 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/list.html @@ -5,7 +5,8 @@

{{ .Title }}

{{ .Content }}
- {{ range .Data.Pages -}} + {{ $paginator := .Paginate (.Data.Pages) -}} + {{ range $paginator.Pages -}}

{{ .Params.title }}

@@ -14,6 +15,8 @@
{{ end -}} + {{ $.Scratch.Set "paginator" true }} + {{ template "_internal/pagination.html" . }}
diff --git a/layouts/docs/single.html b/layouts/docs/single.html index c22f5e1..5c58c54 100644 --- a/layouts/docs/single.html +++ b/layouts/docs/single.html @@ -1,6 +1,6 @@ {{ define "main" }}
-
+
@@ -26,15 +26,23 @@ {{ end }}

{{ .Title }}

{{ .Params.lead | safeHTML }}

+ {{ if ne .Params.toc false -}} + + {{ end -}} {{ partial "main/headline-hash.html" .Content }} {{ if .Site.Params.editPage -}} {{ partial "main/edit-page.html" . }} {{ end -}} + {{ partial "main/docs-navigation.html" . }} +
{{ end }} \ No newline at end of file diff --git a/layouts/index.headers b/layouts/index.headers index ce35f41..8926db5 100644 --- a/layouts/index.headers +++ b/layouts/index.headers @@ -2,8 +2,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'; frame-ancestors https://jamstackthemes.dev; manifest-src 'self'; connect-src 'self'; font-src 'self'; img-src 'self' data:; script-src 'self'; style-src 'self' 'unsafe-inline' + Content-Security-Policy: default-src 'self'; frame-ancestors https://jamstackthemes.dev; manifest-src 'self' https://*.netlify.app; connect-src 'self' https://*.netlify.app; font-src 'self' https://*.netlify.app; img-src 'self' https://*.netlify.app data:; script-src 'self' https://*.netlify.app 'sha512-RBYr6Ld4w1yVqaACrgrBLQfPgGhj/1jyacA74WxJ1KM6KVcSWymwrdDwb3HDcdpwiNJ5yssot1He0U9vXoQVlg=='; style-src 'self' https://*.netlify.app 'unsafe-inline' X-Frame-Options: SAMEORIGIN Referrer-Policy: strict-origin Feature-Policy: geolocation 'self' - Cache-Control: public, max-age=31536000 \ No newline at end of file + Cache-Control: public, max-age=31536000 + Access-Control-Allow-Origin: * \ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html index 9f0c752..57c2e84 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -6,46 +6,48 @@
{{ end }} {{ define "sidebar-prefooter" }} -
-
-
-
-

Security aware

-

Get A+ scores on Mozilla Observatory out of the box. Easily change the default Security Headers to suit your needs.

+ {{ if eq $.Site.Language.LanguageName "English" }} +
+
+
+
+

Security aware

+

Get A+ scores on Mozilla Observatory out of the box. Easily change the default Security Headers to suit your needs.

+
+
+

Fast by default ⚡️

+

Get 100 scores on Google Lighthouse by default. Doks removes unused css, prefetches links, and lazy loads images.

+
+
+

SEO-ready

+

Use sensible defaults for structured data, open graph, and Twitter cards. Or easily change the SEO settings to your liking.

+
-
-

Fast by default ⚡️

-

Get 100 scores on Google Lighthouse by default. Doks removes unused css, prefetches links, and lazy loads images.

-
-
-

SEO-ready

-

Use sensible defaults for structured data, open graph, and Twitter cards. Or easily change the SEO settings to your liking.

+
+
+

Full text search

+

Search your Doks site with FlexSearch. Easily customize index settings and search options to your liking.

+
+
+

Page layouts

+

Build pages with a landing page, blog, or documentation layout. Add custom sections and components to suit your needs.

+
+
+

Dark mode

+

Switch to a low-light UI with the click of a button. Change colors with variables to match your branding.

+
-
-
-

Full text search

-

Search your Doks site with FlexSearch. Easily customize index settings and search options to your liking.

-
-
-

Page layouts

-

Build pages with a landing page, blog, or documentation layout. Add custom sections and components to suit your needs.

-
-
-

Dark mode

-

Switch to a low-light UI with the click of a button. Change colors with variables to match your branding.

-
-
-
-
+
+ {{ end }} {{ end }} {{ define "sidebar-footer" }} diff --git a/layouts/index.redirects b/layouts/index.redirects index 4323285..5d7d6d2 100644 --- a/layouts/index.redirects +++ b/layouts/index.redirects @@ -1,6 +1,13 @@ -# redirects for Netlify - https://www.netlify.com/docs/redirects/ {{- range $p := .Site.Pages -}} {{- range .Aliases }} {{ . }} {{ $p.RelPermalink -}} {{- end }} -{{- end -}} \ No newline at end of file +{{- end -}} + +# /docs/1.0/prologue/ /docs/1.0/prologue/introduction/ +# /docs/1.0/help/ /docs/1.0/help/how-to-update/ +# /docs/1.0/ /docs/1.0/prologue/introduction/ +# /docs/ /docs/1.0/prologue/introduction/ +# +# /docs/0.1/* https://v0-1-0--doks-versioning-poc.netlify.app/docs/0.1/:splat 200 +# /docs/0.2/* https://v0-2-0--doks-versioning-poc.netlify.app/docs/0.2/:splat 200 diff --git a/layouts/partials/footer/alert.html b/layouts/partials/footer/alert.html deleted file mode 100644 index 84d6423..0000000 --- a/layouts/partials/footer/alert.html +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/layouts/partials/footer/footer.html b/layouts/partials/footer/footer.html index bdd7450..bd26030 100644 --- a/layouts/partials/footer/footer.html +++ b/layouts/partials/footer/footer.html @@ -1,5 +1,5 @@