diff --git a/.eslintignore b/.eslintignore index e258d0c..e9d09b5 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,3 @@ +assets/js/index.js assets/js/vendor node_modules \ No newline at end of file diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 282ab12..0f02f7c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -12,7 +12,7 @@ on: # The branches below must be a subset of the branches above branches: [master] schedule: - - cron: '0 22 * * 1' + - cron: '0 11 * * 5' jobs: analyze: diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000..a8b885d --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,10 @@ +{ + "comment": "Hyas rules", + + "default": true, + "line_length": false, + "no-inline-html": false, + "no-trailing-punctuation": false, + "no-duplicate-heading": false, + "no-bare-urls": false +} \ No newline at end of file diff --git a/.markdownlintignore b/.markdownlintignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/.markdownlintignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/.stylelintignore b/.stylelintignore index ee4dea9..3972095 100644 --- a/.stylelintignore +++ b/.stylelintignore @@ -1,3 +1,3 @@ -assets/scss/common/_syntax.scss +assets/scss/components/_syntax.scss assets/scss/vendor node_modules \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 2f60d90..c6f94d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ sudo: required language: node_js node_js: - "lts/*" - - "13" + - "14" install: - wget "https://github.com/gohugoio/hugo/releases/download/v${HUGO_RELEASE}/hugo_extended_${HUGO_RELEASE}_Linux-64bit.deb" @@ -20,4 +20,4 @@ script: env: global: - PRODUCTION=true - - HUGO_RELEASE=0.69.0 \ No newline at end of file + - HUGO_RELEASE=0.75.1 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a6016d..8e4f093 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,25 @@ # Changelog + All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] -### Removed -- negative margin `navbar-brand` -## [0.1.0] - 2020-04-16 +## [0.1.1] - 2020-09-29 + ### Added -- [Hyas](https://github.com/h-enk/hyas), Copyright (c) 2019 Henk Verlinde, [MIT License](https://github.com/h-enk/hyas/blob/master/LICENSE) -[Unreleased]: https://github.com/h-enk/doks/compare/v0.1.0...HEAD -[0.1.0]: https://github.com/h-enk/doks/releases/tag/v0.1.0 +- Base documentation + +## [0.1.0] - 2020-07-10 + +### Added + +- [Feather](https://github.com/feathericons/feather), Copyright (c) 2013-2017 Cole Bemis, [MIT License](https://github.com/feathericons/feather/blob/master/LICENSE) +- [Hyas](https://github.com/h-enk/hyas), Copyright (c) 2020 Henk Verlinde, [MIT License](https://github.com/h-enk/hyas/blob/master/LICENSE) + +[Unreleased]: https://github.com/h-enk/gethyas.com/compare/v0.1.1...HEAD +[0.1.1]: https://github.com/h-enk/gethyas.com/releases/tag/v0.1.1 +[0.1.0]: https://github.com/h-enk/gethyas.com/releases/tag/v0.1.0 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..3d7d695 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at henk@henkverlinde.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/LICENSE b/LICENSE index d060f61..13fef13 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 Henk Verlinde +Copyright (c) 2020 Henk Verlinde Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 92392ac..e10f4d4 100644 --- a/README.md +++ b/README.md @@ -1,59 +1,5 @@ -# Doks -[![GitHub release](https://img.shields.io/github/release/h-enk/doks.svg?style=flat-square)](https://github.com/h-enk/doks/releases) -[![Build Status](https://img.shields.io/travis/h-enk/doks.svg?style=flat-square)](https://travis-ci.com/github/h-enk/doks) -[![Netlify](https://img.shields.io/netlify/8a1009d5-88ac-413e-96ef-3f928674a083?style=flat-square)](https://doks.netlify.app/) +# Hyas website -Doks is a Hugo starter helping you build modern documentation websites. - -## Features -- Lightweight code base -- 100 scores Google Lighthouse -- A+ scores [Mozilla Observatory](https://observatory.mozilla.org/) -- [Algolia DocSearch](https://docsearch.algolia.com/) support -- Dark/Light toggle -- Blog ready -- Easily make it your own -- All in [Hyas](https://github.com/h-enk/hyas) - -See a working example at [doks.netlify.app](https://doks.netlify.app/) - -## Requirements - -Make sure all dependencies have been installed: - -- [Hugo](https://gohugo.io/) >= 0.69.0/extended -- [Node.js](https://nodejs.org/) >= 13.11.0 -- [Yarn](https://yarnpkg.com/) >= 1.22.4 (recommended) - -## Get started - -Create a new Doks project: - -```bash -$ git clone git@github.com:h-enk/doks.git my-doks-site -``` - -Install dependencies: - -```bash -# @ my-doks-site/ -$ yarn install -``` - -Build development theme with live reloading and injection: - -```bash -# @ my-doks-site/ -$ yarn start -``` - -### Other commands -- `yarn lint:styles` - Check Sass for errors -- `yarn lint:scripts` - Check JavaScript for errors -- `yarn clean` - Delete temporary directories -- `yarn build` - Build production theme - -## Documentation -- [Hugo](https://gohugo.io/documentation/) -- [Hyas](https://gethyas.com/) -- [Doks](https://getdoks.org/) +[![GitHub release](https://img.shields.io/github/release/h-enk/gethyas.com.svg?style=flat-square)](https://github.com/h-enk/gethyas.com/releases) +[![Build Status](https://img.shields.io/travis/h-enk/gethyas.com.svg?style=flat-square)](https://travis-ci.com/github/h-enk/gethyas.com) +[![Netlify](https://img.shields.io/netlify/72c25737-babf-44b6-98a5-eeb6861ac904?style=flat-square)](https://gethyas.com/) diff --git a/archetypes/blog.md b/archetypes/blog.md index 1b96724..b495210 100644 --- a/archetypes/blog.md +++ b/archetypes/blog.md @@ -3,9 +3,11 @@ title: "{{ replace .Name "-" " " | title }}" description: "" lead: "" date: {{ .Date }} +lastmod: {{ .Date }} draft: true -images: {{ .Site.Params.images }} -authors: [""] +weight: 50 +images: ["{{ .Name | urlize }}.jpg"] +contributors: ["Henk Verlinde"] --- -{{< img src="" alt="" caption="" class="wide" >}} +{{< img src="{{ .Name | urlize }}.jpg" alt="{{ replace .Name "-" " " | title }}" caption="{{ replace .Name "-" " " | title }}" class="wide" >}} diff --git a/archetypes/default.md b/archetypes/default.md index 383c33d..d8210df 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -2,6 +2,7 @@ title: "{{ replace .Name "-" " " | title }}" description: "" date: {{ .Date }} +lastmod: {{ .Date }} draft: true -images: {{ .Site.Params.images }} +images: [] --- diff --git a/archetypes/docs.md b/archetypes/docs.md index 906f8f9..e572def 100644 --- a/archetypes/docs.md +++ b/archetypes/docs.md @@ -3,8 +3,9 @@ title: "{{ replace .Name "-" " " | title }}" description: "" lead: "" date: {{ .Date }} +lastmod: {{ .Date }} draft: true -images: {{ .Site.Params.images }} +images: [] menu: docs: parent: "" @@ -12,4 +13,4 @@ weight: 999 toc: true --- -{{< img src="" alt="" caption="" class="wide" >}} +{{< img src="{{ .Name | urlize }}.jpg" alt="{{ replace .Name "-" " " | title }}" caption="{{ replace .Name "-" " " | title }}" class="wide" >}} diff --git a/assets/js/app.js b/assets/js/app.js index 0f89b97..4db9115 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -1,8 +1,164 @@ +/* global FlexSearch docs:true a:true t:true d:true */ + document.getElementById('mode').addEventListener('click', () => { + document.body.classList.toggle('dark'); localStorage.setItem('theme', document.body.classList.contains('dark') ? 'dark' : 'light'); + }); if (localStorage.getItem('theme') === 'dark') { + document.body.classList.add('dark'); + } + +/* eslint-disable */ +/* +window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) } + +if (document.querySelector('#deploy-to-netlify') !== null) { + + document.getElementById('deploy-to-netlify').addEventListener('click', function(){ + plausible('Deploy to Netlify'); + }); + +} +*/ +/* eslint-enable */ + +var suggestions = document.getElementById('suggestions'); +var userinput = document.getElementById('userinput'); + +document.addEventListener('keydown', inputFocus); + +function inputFocus(e) { + + if (e.keyCode === 191 ) { + e.preventDefault(); + userinput.focus(); + } + + if (e.keyCode === 27 ) { + userinput.blur(); + suggestions.classList.add('d-none'); + } + +} + +document.addEventListener('click', function(event) { + + var isClickInsideElement = suggestions.contains(event.target); + + if (!isClickInsideElement) { + suggestions.classList.add('d-none'); + } + +}); + + +/* +Source: + - https://dev.to/shubhamprakash/trap-focus-using-javascript-6a3 +*/ + +document.addEventListener('keydown',suggestionFocus); + +function suggestionFocus(e){ + + const focusableSuggestions= suggestions.querySelectorAll('a'); + const focusable= [...focusableSuggestions]; + const index = focusable.indexOf(document.activeElement); + + let nextIndex = 0; + + if (e.keyCode === 38) { + e.preventDefault(); + nextIndex= index > 0 ? index-1 : 0; + focusableSuggestions[nextIndex].focus(); + } + else if (e.keyCode === 40) { + e.preventDefault(); + nextIndex= index+1 < focusable.length ? index+1 : index; + focusableSuggestions[nextIndex].focus(); + } + +} + + +/* +Source: + - https://github.com/nextapps-de/flexsearch#index-documents-field-search + - https://raw.githack.com/nextapps-de/flexsearch/master/demo/autocomplete.html +*/ + +(function(){ + + var index = new FlexSearch({ + preset: 'score', + cache: true, + doc: { + id: 'id', + field: [ + 'title', + 'description', + 'content', + ], + store: [ + 'href', + 'title', + 'description', + ], + }, + }); + + index.add(docs); + + userinput.addEventListener('input', show_results, true); + suggestions.addEventListener('click', accept_suggestion, true); + + function show_results(){ + + var value = this.value; + var results = index.search(value, 5); + var entry, childs = suggestions.childNodes; + var i = 0, len = results.length; + + suggestions.classList.remove('d-none'); + + results.forEach(function(page) { + + entry = document.createElement('div'); + + entry.innerHTML = ''; + + a = entry.querySelector('a'), + t = entry.querySelector('span:first-child'), + d = entry.querySelector('span:nth-child(2)'); + + a.href = page.href; + t.textContent = page.title; + d.textContent = page.description; + + suggestions.appendChild(entry); + + }); + + while(childs.length > len){ + + suggestions.removeChild(childs[i]) + } + + } + + function accept_suggestion(){ + + while(suggestions.lastChild){ + + suggestions.removeChild(suggestions.lastChild); + } + + return false; + } + +}()); diff --git a/assets/js/index.js b/assets/js/index.js new file mode 100644 index 0000000..82dfda8 --- /dev/null +++ b/assets/js/index.js @@ -0,0 +1,11 @@ +var docs = [ +{{ range $index, $page := (where .Site.Pages "Section" "docs") -}} + { + id: {{ $index }}, + href: "{{ .Permalink | absURL }}", + title: {{ .Title | jsonify }}, + description: {{ .Params.description | jsonify }}, + content: {{ .Content | jsonify }} + }, +{{ end -}} +]; \ No newline at end of file diff --git a/assets/scss/app.scss b/assets/scss/app.scss index 1f6691c..91b9db8 100644 --- a/assets/scss/app.scss +++ b/assets/scss/app.scss @@ -8,15 +8,17 @@ @import "bootstrap/scss/bootstrap"; /** Import theme styles */ -// @import "common/fonts"; +@import "common/fonts"; @import "common/global"; @import "common/dark"; -// @import "common/syntax"; +@import "components/alerts"; @import "components/buttons"; @import "components/code"; +// @import "components/syntax"; @import "components/comments"; @import "components/forms"; @import "components/images"; +@import "components/search"; @import "layouts/footer"; @import "layouts/header"; @import "layouts/pages"; diff --git a/assets/scss/common/_dark.scss b/assets/scss/common/_dark.scss index 8d3b126..b5a38c1 100644 --- a/assets/scss/common/_dark.scss +++ b/assets/scss/common/_dark.scss @@ -1,10 +1,23 @@ /** Theme variables */ -$body-bg-dark: lighten($black, 10%); -$body-color-dark: darken($white, 15%); -$link-color-dark: lighten($primary, 20%); -$body-overlay-dark: lighten($black, 15%); -$border-dark: lighten($black, 20%); +// Source: https://material.io/design/color/dark-theme.html + +$body-bg-dark: $gray-900; +$body-overlay-dark: darken($body-bg-dark, 2.5%); +$border-dark: darken($body-bg-dark, 2.5%); +$body-color-dark: $gray-300; +$dots-dark: darken($body-color-dark, 50%); + +$link-color-dark: $blue-300; +$button-color-dark: $link-color-dark; +$focus-color-dark: lighten($link-color-dark, 2.5%); +$selection-color-dark: lighten($link-color-dark, 2.5%); + +$navbar-dark-brand-color: $link-color-dark; +$navbar-dark-brand-hover-color: $body-color-dark; +$navbar-dark-color: $body-color-dark; +$navbar-dark-hover-color: $link-color-dark; +$navbar-dark-active-color: $link-color-dark; /** Theme styles */ @@ -17,8 +30,14 @@ body.dark a { color: $link-color-dark; } +body.dark a.text-body { + color: $body-color-dark !important; +} + body.dark .btn-primary { - color: $body-color-dark; + @include button-variant($button-color-dark, $button-color-dark); + + color: $body-bg-dark !important; } body.dark .navbar { @@ -32,12 +51,12 @@ body.dark.home .navbar { } body.dark .navbar-light .navbar-brand { - color: $navbar-dark-brand-color; + color: $navbar-dark-brand-color !important; } body.dark .navbar-light .navbar-brand:hover, body.dark .navbar-light .navbar-brand:focus { - color: $navbar-dark-brand-hover-color; + color: $navbar-dark-brand-hover-color !important; } body.dark .navbar-light .navbar-nav .nav-link { @@ -64,6 +83,15 @@ body.dark .navbar-light .navbar-text { color: $navbar-dark-color; } +body.dark .alert-primary a { + color: $body-bg-dark; +} + +body.dark .alert-warning { + background: $body-overlay-dark; + color: $body-color-dark; +} + body.dark .page-links a { color: $body-color-dark; } @@ -106,6 +134,14 @@ body.dark .navbar .btn-link:active { body.dark .form-control.is-search { background: $body-overlay-dark; + 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); +} + +body.dark .form-control:focus { + box-shadow: 0 0 0 0.2rem $focus-color-dark; } body.dark .border-top { @@ -124,7 +160,7 @@ body.dark .docs-navigation { } body.dark ::selection { - background: lighten($primary, 25%); + background: $selection-color-dark; } body.dark pre { @@ -138,7 +174,7 @@ body.dark code { } body.dark blockquote { - border-left: 3px solid lighten($black, 30%); + border-left: 3px solid $border-dark; } body.dark .footer { @@ -211,3 +247,28 @@ body.dark .navbar .menu-icon .navicon::before, body.dark .navbar .menu-icon .navicon::after { background: $navbar-dark-color; } + +body.dark .logo-light { + display: none !important; +} + +body.dark .logo-dark { + display: inline-block !important; +} + +body.dark .bg-light { + background: darken($body-bg-dark, 1.5%) !important; +} + +body.dark .bg-dots { + background-image: radial-gradient($dots-dark 15%, transparent 15%); +} + +body.dark .text-muted { + color: darken($body-color-dark, 7.5%) !important; +} + +body.dark .alert-primary { + background: $link-color-dark; + color: $body-bg-dark; +} diff --git a/assets/scss/common/_global.scss b/assets/scss/common/_global.scss index c670c6d..38aac1e 100644 --- a/assets/scss/common/_global.scss +++ b/assets/scss/common/_global.scss @@ -1,7 +1,8 @@ -.authors .content, +.contributors .content, .blog .content, .page .content, -.error404 .content { +.error404 .content, +.docs.list .content { padding-top: 1rem; padding-bottom: 3rem; } @@ -48,12 +49,24 @@ h6, padding-bottom: 5rem; } +.section-md { + padding-top: 3rem; + padding-bottom: 3rem; +} + +.section-sm { + padding-top: 1rem; + padding-bottom: 1rem; +} + +/* .section svg { display: inline-block; width: 2rem; height: 2rem; vertical-align: text-top; } +*/ body { padding-top: 3.5625rem; @@ -128,7 +141,7 @@ body { .docs-navigation { border-top: 1px solid $gray-200; - margin-top: 3rem; + margin-top: 2rem; margin-bottom: 0; padding-top: 2rem; } @@ -139,7 +152,7 @@ body { @include media-breakpoint-up(lg) { .docs-navigation { - margin-bottom: 5rem; + margin-bottom: -1rem; } .docs-navigation a { @@ -153,5 +166,33 @@ body { } ::selection { - background: lighten($primary, 45%); + background: lighten($primary, 55%); +} + +.bg-dots { + background-image: radial-gradient($gray-300 15%, transparent 15%); + background-position: 0 0; + background-size: 1rem 1rem; + -webkit-mask: linear-gradient(to top, #fff, transparent); + mask: linear-gradient(to top, #fff, transparent); + width: 100%; + height: 9rem; + margin-top: -10rem; + z-index: -1; +} + +.bg-dots-lg { + margin-top: -12rem; +} + +// https://fossheim.io/writing/posts/css-text-gradient/ +.gradient-text { + background-color: $primary; + background-image: linear-gradient(90deg, $primary, $blue-300 50%, $pink-500); + background-size: 100%; + background-repeat: repeat; + -webkit-background-clip: text; + -moz-background-clip: text; + -webkit-text-fill-color: transparent; + -moz-text-fill-color: transparent; } diff --git a/assets/scss/common/_syntax.scss b/assets/scss/common/_syntax.scss deleted file mode 100644 index 51b1d84..0000000 --- a/assets/scss/common/_syntax.scss +++ /dev/null @@ -1,60 +0,0 @@ -/* Background */ .chroma { color: #f8f8f2; background-color: #282a36 } -/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; } -/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; width: auto; overflow: auto; display: block; } -/* LineHighlight */ .chroma .hl { display: block; width: 100%;background-color: #ffffcc } -/* LineNumbersTable */ .chroma .lnt { margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f } -/* LineNumbers */ .chroma .ln { margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f } -/* Keyword */ .chroma .k { color: #ff79c6 } -/* KeywordConstant */ .chroma .kc { color: #ff79c6 } -/* KeywordDeclaration */ .chroma .kd { color: #8be9fd; font-style: italic } -/* KeywordNamespace */ .chroma .kn { color: #ff79c6 } -/* KeywordPseudo */ .chroma .kp { color: #ff79c6 } -/* KeywordReserved */ .chroma .kr { color: #ff79c6 } -/* KeywordType */ .chroma .kt { color: #8be9fd } -/* NameAttribute */ .chroma .na { color: #50fa7b } -/* NameBuiltin */ .chroma .nb { color: #8be9fd; font-style: italic } -/* NameClass */ .chroma .nc { color: #50fa7b } -/* NameFunction */ .chroma .nf { color: #50fa7b } -/* NameLabel */ .chroma .nl { color: #8be9fd; font-style: italic } -/* NameTag */ .chroma .nt { color: #ff79c6 } -/* NameVariable */ .chroma .nv { color: #8be9fd; font-style: italic } -/* NameVariableClass */ .chroma .vc { color: #8be9fd; font-style: italic } -/* NameVariableGlobal */ .chroma .vg { color: #8be9fd; font-style: italic } -/* NameVariableInstance */ .chroma .vi { color: #8be9fd; font-style: italic } -/* LiteralString */ .chroma .s { color: #f1fa8c } -/* LiteralStringAffix */ .chroma .sa { color: #f1fa8c } -/* LiteralStringBacktick */ .chroma .sb { color: #f1fa8c } -/* LiteralStringChar */ .chroma .sc { color: #f1fa8c } -/* LiteralStringDelimiter */ .chroma .dl { color: #f1fa8c } -/* LiteralStringDoc */ .chroma .sd { color: #f1fa8c } -/* LiteralStringDouble */ .chroma .s2 { color: #f1fa8c } -/* LiteralStringEscape */ .chroma .se { color: #f1fa8c } -/* LiteralStringHeredoc */ .chroma .sh { color: #f1fa8c } -/* LiteralStringInterpol */ .chroma .si { color: #f1fa8c } -/* LiteralStringOther */ .chroma .sx { color: #f1fa8c } -/* LiteralStringRegex */ .chroma .sr { color: #f1fa8c } -/* LiteralStringSingle */ .chroma .s1 { color: #f1fa8c } -/* LiteralStringSymbol */ .chroma .ss { color: #f1fa8c } -/* LiteralNumber */ .chroma .m { color: #bd93f9 } -/* LiteralNumberBin */ .chroma .mb { color: #bd93f9 } -/* LiteralNumberFloat */ .chroma .mf { color: #bd93f9 } -/* LiteralNumberHex */ .chroma .mh { color: #bd93f9 } -/* LiteralNumberInteger */ .chroma .mi { color: #bd93f9 } -/* LiteralNumberIntegerLong */ .chroma .il { color: #bd93f9 } -/* LiteralNumberOct */ .chroma .mo { color: #bd93f9 } -/* Operator */ .chroma .o { color: #ff79c6 } -/* OperatorWord */ .chroma .ow { color: #ff79c6 } -/* Comment */ .chroma .c { color: #6272a4 } -/* CommentHashbang */ .chroma .ch { color: #6272a4 } -/* CommentMultiline */ .chroma .cm { color: #6272a4 } -/* CommentSingle */ .chroma .c1 { color: #6272a4 } -/* CommentSpecial */ .chroma .cs { color: #6272a4 } -/* CommentPreproc */ .chroma .cp { color: #ff79c6 } -/* CommentPreprocFile */ .chroma .cpf { color: #ff79c6 } -/* GenericDeleted */ .chroma .gd { color: #8b080b } -/* GenericEmph */ .chroma .ge { text-decoration: underline } -/* GenericHeading */ .chroma .gh { font-weight: bold } -/* GenericInserted */ .chroma .gi { font-weight: bold } -/* GenericOutput */ .chroma .go { color: #44475a } -/* GenericSubheading */ .chroma .gu { font-weight: bold } -/* GenericUnderline */ .chroma .gl { text-decoration: underline } diff --git a/assets/scss/common/_variables.scss b/assets/scss/common/_variables.scss index 163e194..125930e 100644 --- a/assets/scss/common/_variables.scss +++ b/assets/scss/common/_variables.scss @@ -1,16 +1,4 @@ -/* -$theme-colors: ( - primary: #3c48d5 -); -*/ - -$yellow: #ffe000; -$black: #1d2d35; -$white: #fff; -$beige: #fbf7f0; -$red: #e55235; -$purple: #5d2f86; -$brown: #aa9c84; +// Color system $white: #fff; $gray-100: #f8f9fa; @@ -24,8 +12,17 @@ $gray-800: #343a40; $gray-900: #212529; $black: #000; -$primary: lighten($purple, 10%); -$secondary: $gray-200; +$yellow: #ffe000; +$black: #1d2d35; +$beige: #fbf7f0; +$red: #e55235; +$purple: #5d2f86; +$brown: #aa9c84; + +$blue-300: #8ed6fb; +$pink-500: #d32e9d; + +$primary: $purple; /** Bootstrap navbar fix (https://git.io/fADqW) */ $navbar-dark-toggler-icon-bg: none; @@ -42,7 +39,7 @@ $enable-responsive-font-sizes: true; // Settings for the `` element. $body-bg: $white; -$body-color: lighten($black, 10%); +$body-color: $black; // Grid containers // @@ -65,6 +62,12 @@ $grid-columns: 16; $grid-gutter-width: 48px; $grid-row-columns: 6; +// Components +// +// Define common padding and border radius sizes and more. + +$border-color: $gray-200; + // Typography // // Font, line-height, and color for body text, headings, and more. @@ -100,3 +103,26 @@ $navbar-padding-y: $spacer / 2; $navbar-padding-x: 0; $navbar-nav-link-padding-x: 0.5rem; + +$navbar-light-color: $black; +$navbar-light-hover-color: $primary; +$navbar-light-active-color: $primary; + +// Cards + +$card-border-color: $gray-200; + +// Alerts +// +// Define alert colors, border radius, and padding. + +$alert-padding-y: 1rem; +$alert-padding-x: 1.5rem; +$alert-margin-bottom: 0; +$alert-border-radius: 0; +$alert-link-font-weight: $headings-font-weight; +$alert-border-width: 0; + +$alert-bg-level: 0; +$alert-border-level: 0; +$alert-color-level: 0; diff --git a/assets/scss/components/_alerts.scss b/assets/scss/components/_alerts.scss new file mode 100644 index 0000000..b40c571 --- /dev/null +++ b/assets/scss/components/_alerts.scss @@ -0,0 +1,63 @@ +.alert { + font-family: $font-family-monospace; + font-size: $font-size-sm; +} + +.alert-icon { + margin-right: 0.75rem; +} + +.docs .alert { + margin: 2rem -1.5rem; +} + +.alert .alert-link { + text-decoration: underline; +} + +.alert-dark { + color: $white; + background-color: $black; +} + +.alert-dark .alert-link { + color: $white; +} + +.alert-light { + color: $black; +} + +.alert-warning { + background: $beige; + color: $black; +} + +/* +.alert-light { + color: #215888; + background: linear-gradient(-45deg, rgb(212, 245, 255), rgb(234, 250, 255), rgb(234, 250, 255), #d3f6ef); +} + +.alert-light .alert-link { + color: #215888; +} +*/ + +.alert-white { + background-color: rgba(255, 255, 255, 0.95); +} + +.alert-primary { + color: $white; + background-color: $primary; +} + +.alert-primary .alert-link { + color: $white; +} + +.alert .alert-link:hover, +.alert .alert-link:focus { + text-decoration: none; +} diff --git a/assets/scss/components/_buttons.scss b/assets/scss/components/_buttons.scss index 40f8a8f..d9bb621 100644 --- a/assets/scss/components/_buttons.scss +++ b/assets/scss/components/_buttons.scss @@ -7,6 +7,11 @@ margin-right: 1.25rem; } +.btn-link:focus { + outline: 0; + box-shadow: none; +} + #navigation { margin-left: 1.25rem; } @@ -44,3 +49,26 @@ body.dark .toggle-light { body.dark .toggle-dark { display: none; } + +.btn-clipboard { + display: none; +} + +@include media-breakpoint-up(md) { + .btn-clipboard { + display: block; + margin: 2.0625rem 0.25rem -4rem auto; + } +} + +.copy-status::after, +.copy-status:hover::after { + content: "Copy"; + display: block; +} + +.copy-status:focus::after, +.copy-status:active::after { + content: "Copied"; + display: block; +} diff --git a/assets/scss/components/_code.scss b/assets/scss/components/_code.scss index cde4684..130c610 100644 --- a/assets/scss/components/_code.scss +++ b/assets/scss/components/_code.scss @@ -1,10 +1,3 @@ -/* -.highlight { - margin-left: -1.5rem; - margin-right: -1.5rem; -} -*/ - pre, code, kbd, @@ -15,8 +8,8 @@ samp { } pre { - background: lighten($black, 15%); - color: $beige; + background: $beige; + color: $black; line-height: $line-height-lg; margin: 2rem 0; overflow: auto; @@ -35,3 +28,16 @@ pre code { font-size: inherit; padding: 0; } + +@include media-breakpoint-down(xs) { + pre { + margin: 2rem -1.5rem; + } + + pre, + code, + kbd, + samp { + border-radius: 0; + } +} diff --git a/assets/scss/components/_images.scss b/assets/scss/components/_images.scss index cc6c3b6..254eefa 100644 --- a/assets/scss/components/_images.scss +++ b/assets/scss/components/_images.scss @@ -1,20 +1,3 @@ -.img svg, -.img img { - margin: 0; - width: 100%; - height: auto; -} - -.img { - position: relative; -} - -.img img { - position: absolute; - top: 0; - left: 0; -} - figure { margin: 2rem 0; } @@ -33,11 +16,11 @@ figure.wide .figure-caption { @include media-breakpoint-up(md) { figure.wide { - margin: 2rem -3rem; + margin: 2rem -2.5rem; } figure.wide .figure-caption { - margin: 0.25rem 3rem 0.75rem; + margin: 0.25rem 2.5rem 0.75rem; } } @@ -52,12 +35,14 @@ figure.wide .figure-caption { } .blur-up { - -webkit-filter: blur(5px); filter: blur(5px); - transition: filter 300ms, -webkit-filter 300ms; } .blur-up.lazyloaded { - -webkit-filter: blur(0); - filter: blur(0); + filter: unset; +} + +.img-simple { + margin-top: 0.375rem; + margin-bottom: 1.25rem; } diff --git a/assets/scss/components/_search.scss b/assets/scss/components/_search.scss new file mode 100644 index 0000000..3a70b2b --- /dev/null +++ b/assets/scss/components/_search.scss @@ -0,0 +1,75 @@ +.navbar-form { + position: relative; +} + +#suggestions { + position: absolute; + right: 0; + margin-top: 0.5rem; + width: calc(100vw - 3rem); +} + +#suggestions a { + display: block; + text-decoration: none; + padding: 0.75rem; + margin: 0 0.5rem; +} + +#suggestions a:focus { + background: $gray-100; + outline: 0; +} + +#suggestions div:not(:first-child) { + border-top: 1px dashed $gray-200; +} + +#suggestions div:first-child { + margin-top: 0.5rem; +} + +#suggestions div:last-child { + margin-bottom: 0.5rem; +} + +#suggestions a:hover { + background: $gray-100; +} + +#suggestions span { + display: flex; + font-size: $font-size-base; +} + +#suggestions span:first-child { + font-weight: $headings-font-weight; + color: $black; +} + +#suggestions span:nth-child(2) { + color: $gray-700; +} + +@include media-breakpoint-up(sm) { + #suggestions { + width: 30rem; + } + + #suggestions a { + display: flex; + } + + #suggestions span:first-child { + width: 9rem; + padding-right: 1rem; + border-right: 1px solid $gray-200; + display: inline-block; + text-align: right; + } + + #suggestions span:nth-child(2) { + width: 19rem; + padding-left: 1rem; + } +} diff --git a/assets/scss/components/_syntax.scss b/assets/scss/components/_syntax.scss new file mode 100644 index 0000000..d9a1c02 --- /dev/null +++ b/assets/scss/components/_syntax.scss @@ -0,0 +1,131 @@ +/*! + * GitHub Light v0.5.0 + * Copyright (c) 2012 - 2017 GitHub, Inc. + * Licensed under MIT (https://github.com/primer/github-syntax-theme-generator/blob/master/LICENSE) + */ + + .c1, + .c /* comment, punctuation.definition.comment, string.comment */ { + color: #6a737d; + } + + .v /* variable */, + .smw /* sublimelinter.mark.warning */ { + color: #e36209; + } + + // .c1 /* constant, entity.name.constant, variable.other.constant, variable.language, support, meta.property-name, support.constant, support.variable, meta.module-reference, markup.raw, meta.diff.header, meta.output */, + .s .v /* string variable */ { + color: #005cc5; + } + + .e /* entity */, + .en /* entity.name */ { + color: #6f42c1; + } + + .smi /* variable.parameter.function, storage.modifier.package, storage.modifier.import, storage.type.java, variable.other */, + .s .s1 /* string source */ { + color: #24292e; + } + + .ent /* entity.name.tag, markup.quote */ { + color: #22863a; + } + + .k /* keyword, storage, storage.type */ { + color: #d73a49; + } + + .s /* string */, + .pds /* punctuation.definition.string, source.regexp, string.regexp.character-class */, + .s .pse .s1 /* string punctuation.section.embedded source */, + .sr /* string.regexp */, + .sr .cce /* string.regexp constant.character.escape */, + .sr .sre /* string.regexp source.ruby.embedded */, + .sr .sra /* string.regexp string.regexp.arbitrary-repitition */ { + color: #032f62; + } + + .bu /* invalid.broken, invalid.deprecated, invalid.unimplemented, message.error, brackethighlighter.unmatched, sublimelinter.mark.error */ { + color: #b31d28; + } + + .ii /* invalid.illegal */ { + color: #fafbfc; + background-color: #b31d28; + } + + .c2 /* carriage-return */ { + color: #fafbfc; + background-color: #d73a49; + } + + .c2::before /* carriage-return */ { + content: "^M"; + } + + .sr .cce /* string.regexp constant.character.escape */ { + font-weight: bold; + color: #22863a; + } + + .ml /* markup.list */ { + color: #735c0f; + } + + .mh /* markup.heading */, + .mh .en /* markup.heading entity.name */, + .ms /* meta.separator */ { + font-weight: bold; + color: #005cc5; + } + + .mi /* markup.italic */ { + font-style: italic; + color: #24292e; + } + + .mb /* markup.bold */ { + font-weight: bold; + color: #24292e; + } + + .md /* markup.deleted, meta.diff.header.from-file, punctuation.definition.deleted */ { + color: #b31d28; + background-color: #ffeef0; + } + + .mi1 /* markup.inserted, meta.diff.header.to-file, punctuation.definition.inserted */ { + color: #22863a; + background-color: #f0fff4; + } + + .mc /* markup.changed, punctuation.definition.changed */ { + color: #e36209; + background-color: #ffebda; + } + + .mi2 /* markup.ignored, markup.untracked */ { + color: #f6f8fa; + background-color: #005cc5; + } + + .mdr /* meta.diff.range */ { + font-weight: bold; + color: #6f42c1; + } + + .ba /* brackethighlighter.tag, brackethighlighter.curly, brackethighlighter.round, brackethighlighter.square, brackethighlighter.angle, brackethighlighter.quote */ { + color: #586069; + } + + .sg /* sublimelinter.gutter-mark */ { + color: #959da5; + } + + .corl /* constant.other.reference.link, string.other.link */ { + text-decoration: underline; + color: #032f62; + } + \ No newline at end of file diff --git a/assets/scss/layouts/_footer.scss b/assets/scss/layouts/_footer.scss index ce1eb4a..7d21811 100644 --- a/assets/scss/layouts/_footer.scss +++ b/assets/scss/layouts/_footer.scss @@ -8,15 +8,13 @@ margin-bottom: 0; } -.footer p, -.footer li a { +.footer li { font-size: $font-size-sm; margin-bottom: 0; } @include media-breakpoint-up(md) { - .footer p, - .footer li a { + .footer li { font-size: $font-size-base; } } diff --git a/assets/scss/layouts/_header.scss b/assets/scss/layouts/_header.scss index d07bbbd..a4ef3d6 100644 --- a/assets/scss/layouts/_header.scss +++ b/assets/scss/layouts/_header.scss @@ -10,6 +10,16 @@ margin-left: 1rem; } +.navbar-brand { + font-weight: $headings-font-weight; +} + +.navbar-light .navbar-brand, +.navbar-light .navbar-brand:hover, +.navbar-light .navbar-brand:active { + color: $body-color; +} + @include media-breakpoint-up(md) { .navbar-brand { font-size: $font-size-xl; @@ -55,12 +65,11 @@ .navbar { background-color: rgba(255, 255, 255, 0.95); border-bottom: 1px solid $gray-200; - - /* margin-top: 3px; */ + margin-top: 4px; } .header-bar { - border-top: 3px solid; + border-top: 4px solid; border-image-source: linear-gradient(90deg, $primary, #8ed6fb 50%, #d32e9d); border-image-slice: 1; } @@ -90,11 +99,23 @@ .navbar-form { margin-top: 0; - margin-left: 1.5rem; + margin-left: 9rem; margin-right: 1.5rem; } } +@include media-breakpoint-up(lg) { + .navbar-form { + margin-left: 18rem; + } +} + +@include media-breakpoint-up(xl) { + .navbar-form { + margin-left: 36rem; + } +} + .form-control.is-search { padding-right: calc(1.5em + 0.75rem); background: $gray-100; @@ -105,6 +126,44 @@ background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem); } +/*! purgecss start ignore */ +.algolia-autocomplete { + display: flex !important; +} + +.algolia-autocomplete .ds-dropdown-menu { + box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important; +} + +@include media-breakpoint-down(sm) { + .algolia-autocomplete .ds-dropdown-menu { + max-width: 512px !important; + min-width: 312px !important; + width: auto !important; + } + + .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--subcategory-column::after { + content: "|"; + margin-right: 0.25rem; + } +} + +.algolia-autocomplete .algolia-docsearch-suggestion--title { + margin-bottom: 0; +} + +.algolia-autocomplete .algolia-docsearch-suggestion--highlight { + padding: 0 0.05em; +} + +.algolia-autocomplete .algolia-docsearch-footer { + margin-top: 1rem; + margin-right: 0.5rem; + margin-bottom: 0.5rem; +} + +/*! purgecss end ignore */ + /* * Source: https://medium.com/creative-technology-concepts-code/responsive-mobile-dropdown-navigation-using-css-only-7218e4498a99 */ diff --git a/assets/scss/layouts/_pages.scss b/assets/scss/layouts/_pages.scss index 7b34e12..eaa75de 100644 --- a/assets/scss/layouts/_pages.scss +++ b/assets/scss/layouts/_pages.scss @@ -23,3 +23,18 @@ h4:hover a { .card-list { margin-top: 2.25rem; } + +.edit-page { + margin-top: 3rem; + font-size: $font-size-base; +} + +.edit-page svg { + margin-right: 0.5rem; + margin-bottom: 0.25rem; +} + +p.meta { + margin-top: 0.5rem; + font-size: $font-size-base; +} diff --git a/assets/scss/layouts/_posts.scss b/assets/scss/layouts/_posts.scss index d43e3df..da27660 100644 --- a/assets/scss/layouts/_posts.scss +++ b/assets/scss/layouts/_posts.scss @@ -1,16 +1,19 @@ -.authors.list .card, +.home .card, +.contributors.list .card, .blog.list .card { margin-top: 2rem; margin-bottom: 2rem; transition: transform 0.3s; } -.authors.list .card:hover, +.home .card:hover, +.contributors.list .card:hover, .blog.list .card:hover { transform: scale(1.025); } -.authors.list .card-body, +.home .card-body, +.contributors.list .card-body, .blog.list .card-body { padding: 0 2rem 1rem; } diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..ce9c9de --- /dev/null +++ b/babel.config.js @@ -0,0 +1,17 @@ +module.exports = { + presets: [ + [ + '@babel/preset-env', + { + targets: { + browsers: [ + // Best practice: https://github.com/babel/babel/issues/7789 + '>=1%', + 'not ie 11', + 'not op_mini all' + ] + } + } + ] + ] +}; \ No newline at end of file diff --git a/config/_default/config.toml b/config/_default/config.toml index 51cce44..0ceb830 100644 --- a/config/_default/config.toml +++ b/config/_default/config.toml @@ -1,19 +1,17 @@ baseurl = "/" disableAliases = true disableHugoGeneratorInject = true -# disableKinds = ["taxonomy", "taxonomyTerm"] enableEmoji = true +enableGitInfo = true enableRobotsTXT = true languageCode = "en-US" paginate = 7 rssLimit = 10 -[taxonomies] - author = "authors" - # add redirects/headers [outputs] home = ["HTML", "RSS", "REDIRECTS", "HEADERS"] +section = ["HTML", "SITEMAP"] # remove .{ext} from text/netlify [mediaTypes."text/netlify"] @@ -22,24 +20,36 @@ delimiter = "" # add output format for netlify _redirects [outputFormats.REDIRECTS] -mediatype = "text/netlify" +mediaType = "text/netlify" baseName = "_redirects" isPlainText = true notAlternative = true # add output format for netlify _headers [outputFormats.HEADERS] -mediatype = "text/netlify" +mediaType = "text/netlify" baseName = "_headers" isPlainText = true notAlternative = true +# add output format for section sitemap.xml +[outputFormats.SITEMAP] +mediaType = "application/xml" +baseName = "sitemap" +isHTML = false +isPlainText = true +noUgly = true +rel = "sitemap" + [markup] [markup.goldmark] + [markup.goldmark.extensions] + linkify = false [markup.goldmark.renderer] unsafe = true [markup.highlight] codeFences = true + guessSyntax = false hl_Lines = "" lineNoStart = 1 lineNos = false @@ -53,6 +63,12 @@ notAlternative = true filename = "sitemap.xml" priority = 0.5 +[taxonomies] + contributor = "contributors" + +[permalinks] + blog = "/blog/:title/" + [module] [[module.mounts]] source = "assets" @@ -64,5 +80,11 @@ notAlternative = true source = "node_modules/lazysizes" target = "assets/js/vendor/lazysizes" [[module.mounts]] - source = "node_modules/ga-lite/dist" - target = "static/js/vendor/ga-lite" + source = "node_modules/instant.page" + target = "assets/js/vendor/instant.page" + [[module.mounts]] + source = "node_modules/lazysizes" + target = "assets/js/vendor/lazysizes" + [[module.mounts]] + source = "node_modules/flexsearch" + target = "assets/js/vendor/flexsearch" diff --git a/config/_default/menus.toml b/config/_default/menus.toml index 5e1813d..10fa10e 100644 --- a/config/_default/menus.toml +++ b/config/_default/menus.toml @@ -5,8 +5,26 @@ url = "/docs/prologue/" [[docs]] - name = "Help" + name = "Basic Hyas" weight = 20 + identifier = "basic-hyas" + url = "/docs/basic-hyas/" + +[[docs]] + name = "Core Hyas" + weight = 30 + identifier = "core-hyas" + url = "/docs/core-hyas/" + +[[docs]] + name = "Guides" + weight = 40 + identifier = "guides" + url = "/docs/guides/" + +[[docs]] + name = "Help" + weight = 50 identifier = "help" url = "/docs/help/" @@ -20,14 +38,15 @@ url = "/blog/" weight = 20 -[[social]] - name = "Twitter" - pre = "" - url = "https://twitter.com/getdoks" - weight = 10 +# [[social]] +# name = "Twitter" +# pre = "" +# url = "https://twitter.com/gethyas" +# weight = 10 [[social]] name = "GitHub" pre = "" url = "https://github.com/h-enk/doks" + post = "v0.1.0" weight = 20 diff --git a/config/_default/params.toml b/config/_default/params.toml index 491a6ee..4a8806d 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -1,27 +1,38 @@ title = "Doks" titleSeparator = "-" -titleAddition = "Modern Hugo Documentation Starter" -description = "Hugo starter helping you build modern documentation websites." -images = ["image-doks.png"] -twitterSite = "@henkverlinde" -twitterCreator = "@henkverlinde" +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." + +images = ["hyas.png"] + +twitterSite = "henkverlinde" +twitterCreator = "henkverlinde" +facebookAuthor = "verlinde.henk" +facebookPublisher = "verlinde.henk" ogLocale = "en_US" + schemaType = "Organization" -schemaLogo = "logo-doks.png" -schemaTwitter = "https://twitter.com/getdoks" +schemaLogo = "logo-hyas.png" +schemaTwitter = "https://twitter.com/henkverlinde" schemaLinkedIn = "https://www.linkedin.com/in/henkverlinde/" -schemaSection = "news" +schemaGitHub = "https://github.com/h-enk" +schemaSection = "blog" + siteLinksSearchBox = false themeColor = "#fff" -# googleAnalytics = "UA-99999999-1" - quality = 85 bgColor = "#fff" -landscapePhotoWidths = [900, 700, 500] -portraitPhotoWidths = [1500, 1000, 750] +landscapePhotoWidths = [1000, 800, 700, 600, 500] +portraitPhotoWidths = [800, 700, 600, 500] lqipWidth = "20x" -footer = "© 2020 Henk Verlinde - MIT License" -version = "v0.1.0" +footer = "An open source project by @HenkVerlinde" + +alert = false +alertText = "Like Doks? Star on GitHub. Thanks!" + +hyasVersion = "v0.2.0" + +docsRepo = "https://github.com/h-enk/doks" diff --git a/config/postcss.config.js b/config/postcss.config.js index eea7a78..119d5f1 100644 --- a/config/postcss.config.js +++ b/config/postcss.config.js @@ -10,12 +10,12 @@ module.exports = { './layouts/**/*.html', './content/**/*.md', ], - whitelist: [ + safelist: [ 'lazyloaded', ...whitelister([ - './assets/scss/common/_dark.scss', - './assets/scss/common/_syntax.scss', './assets/scss/components/_code.scss', + './assets/scss/components/_search.scss', + './assets/scss/common/_dark.scss', ]), ], }), diff --git a/config/production/params.toml b/config/production/.gitkeep similarity index 100% rename from config/production/params.toml rename to config/production/.gitkeep diff --git a/config/production/config.toml b/config/production/config.toml deleted file mode 100644 index 0a9e67b..0000000 --- a/config/production/config.toml +++ /dev/null @@ -1,2 +0,0 @@ -baseurl = "https://doks.netlify.app/" -canonifyURLs = false diff --git a/config/staging/params.toml b/config/staging/.gitkeep similarity index 100% rename from config/staging/params.toml rename to config/staging/.gitkeep diff --git a/config/staging/config.toml b/config/staging/config.toml deleted file mode 100644 index 14e8022..0000000 --- a/config/staging/config.toml +++ /dev/null @@ -1,2 +0,0 @@ -baseurl = "https://doks-staging.netlify.app/" -canonifyURLs = false diff --git a/content/_index.md b/content/_index.md index ce8c3a9..d3ac3c4 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1,23 +1,13 @@ --- -title : "Doks" -description: "Hugo starter helping you build modern documentation websites." -date: 2020-04-17T08:47:36+00:00 +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: [image-doks.png] -lead: "Hugo starter helping you build modern documentation websites." +images: [] --- -
-
-

100/A+ scores

-

Get perfect Google Lighthouse and Mozilla Observatory scores by default.

-
-
-

Algolia DocSearch

-

The best search experience for docs, by Algolia, for free.

-
-
-

Dark/Light toggle

-

Enable dark mode at night or in dark environments.

-
-
\ No newline at end of file + diff --git a/content/authors/_index.md b/content/authors/_index.md deleted file mode 100644 index 976ef7b..0000000 --- a/content/authors/_index.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: "Authors" -description: "The Doks Blog authors." -date: 2020-04-17T08:50:29+00:00 -draft: false -images: [image-doks.png] ---- - -The Doks Blog authors diff --git a/content/authors/henk-verlinde/_index.md b/content/authors/henk-verlinde/_index.md deleted file mode 100644 index 17eb2a0..0000000 --- a/content/authors/henk-verlinde/_index.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "Henk Verlinde" -description: "Creator of Doks." -date: 2020-04-17T08:50:45+00:00 -draft: false -images: [image-doks.png] ---- - -Creator of Doks. - -[@HenkVerlinde](https://twitter.com/henkverlinde) diff --git a/content/blog/_index.md b/content/blog/_index.md index 89cee49..ed7767a 100644 --- a/content/blog/_index.md +++ b/content/blog/_index.md @@ -1,7 +1,8 @@ --- title: "Blog" -description: "The Doks Blog." -date: 2020-04-17T08:49:55+00:00 +description: "The Hyas Blog." +date: 2020-10-06T08:49:55+00:00 +lastmod: 2020-10-06T08:49:55+00:00 draft: false -images: [image-doks.png] +images: [] --- diff --git a/content/blog/say-hello-to-doks/index.md b/content/blog/say-hello-to-doks/index.md deleted file mode 100644 index 90057de..0000000 --- a/content/blog/say-hello-to-doks/index.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: "Say hello to Doks 👋" -description: "Doks is a Hugo starter helping you build modern documentation websites." -lead: "Doks is a Hugo starter helping you build modern documentation websites." -date: 2020-04-17T08:50:12+00:00 -draft: false -images: [image-doks.png] -authors: ["Henk Verlinde"] ---- diff --git a/content/blog/say-hello-to-hyas/google-lighthouse-scores-hyas.png b/content/blog/say-hello-to-hyas/google-lighthouse-scores-hyas.png new file mode 100644 index 0000000..5fc2c48 Binary files /dev/null and b/content/blog/say-hello-to-hyas/google-lighthouse-scores-hyas.png differ diff --git a/content/blog/say-hello-to-hyas/index.md b/content/blog/say-hello-to-hyas/index.md new file mode 100644 index 0000000..7b0b073 --- /dev/null +++ b/content/blog/say-hello-to-hyas/index.md @@ -0,0 +1,55 @@ +--- +title: "Say hello to Hyas 👋" +description: "Introducing Hyas, a Hugo starter helping you build modern websites that are secure, fast, and SEO-ready — by default." +lead: "Introducing Hyas, a Hugo starter helping you build modern websites that are secure, fast, and SEO-ready — by default." +date: 2020-10-06T08:50:12+00:00 +lastmod: 2020-10-06T08:50:12+00:00 +draft: false +weight: 50 +images: ["say-hello-to-hyas.png", "google-lighthouse-scores-hyas.png", "mozilla-observatory-scores-hyas.png"] +contributors: ["Henk Verlinde"] +--- + +## Solid as a rock + +Some website projects require a solid starting point. With a great developer experience and a sound user experience. Sometimes you just don't want to start from scratch. That's why I created Hyas 💚 + +## This is how we do it + +Making use of the power of Hugo. Following best practices for performance, SEO and security. Optimized for the Netlify platform. And always flexible, so you can easily make it your own. + +## Say Whaaat? + +- Security aware +- Fast by default ⚡️ +- SEO-ready +- Development tools (linting, cleaning) +- Bootstrap framework +- Netlify-ready (functions, redirects, headers) + +### 100 scores on Google Lighthouse + +{{< img-simple src="google-lighthouse-scores-hyas.png" alt="Google Lighthouse Scores Hyas" >}} + +Get 100 scores on [Google Lighthouse](https://googlechrome.github.io/lighthouse/viewer/?gist=8b7aec005ae7b9e128ad5c4e2f125fea) by default. Hyas removes unused css, prefetches links, and lazy loads images. + +### A+ scores on Mozilla Observatory + +Get A+ scores on [Mozilla Observatory](https://observatory.mozilla.org/analyze/hyas.netlify.app) out of the box. Easily change the default Security Headers to suit your needs. + +### What's with the name? + +Hyas used [Atlas](https://github.com/indigotree/atlas) 🙏 as a starting point. In Greek mythology, +[Hyas](https://www.greekmythology.com/Other_Gods/Minor_Gods/Hyas/hyas.html) was the son of the Titan Atlas and the Oceanid Aethra. + +## Do what? + +[Check out the docs]({{< ref "introduction" >}}) or [Deploy to Netlify](https://app.netlify.com/start/deploy?repository=https://github.com/h-enk/hyas) in less than a minute. + +### Contribute + +Contributions are welcome. Check the [Code of Conduct](https://github.com/h-enk/hyas/blob/master/CODE_OF_CONDUCT.md). [Suggest an idea](https://github.com/h-enk/hyas/issues/new?template=feature-request---.md), [Create a bug report](https://github.com/h-enk/hyas/issues/new?template=bug-report---.md), or [Improve the documentation](https://github.com/h-enk/gethyas.com/tree/master/content/docs). + +### Star + +Like Hyas? [Star the Hyas repo on GitHub](https://github.com/h-enk/hyas/stargazers). Thanks! diff --git a/content/blog/say-hello-to-hyas/mozilla-observatory-scores-hyas.png b/content/blog/say-hello-to-hyas/mozilla-observatory-scores-hyas.png new file mode 100644 index 0000000..03e88e5 Binary files /dev/null and b/content/blog/say-hello-to-hyas/mozilla-observatory-scores-hyas.png differ diff --git a/content/blog/say-hello-to-hyas/say-hello-to-hyas.png b/content/blog/say-hello-to-hyas/say-hello-to-hyas.png new file mode 100644 index 0000000..a131a0d Binary files /dev/null and b/content/blog/say-hello-to-hyas/say-hello-to-hyas.png differ diff --git a/content/contact/index.md b/content/contact/index.md new file mode 100644 index 0000000..3eb42f8 --- /dev/null +++ b/content/contact/index.md @@ -0,0 +1,10 @@ +--- +title: "Contact" +description: "Email Henk Verlinde" +date: 2020-08-27T19:25:12+02:00 +lastmod: 2020-08-27T19:25:12+02:00 +draft: true +images: [] +--- + +

diff --git a/content/contributors/_index.md b/content/contributors/_index.md new file mode 100644 index 0000000..f115059 --- /dev/null +++ b/content/contributors/_index.md @@ -0,0 +1,10 @@ +--- +title: "Contributors" +description: "The Hyas contributors." +date: 2020-10-06T08:50:29+00:00 +lastmod: 2020-10-06T08:50:29+00:00 +draft: false +images: [] +--- + +The Hyas contributors. diff --git a/content/contributors/henk-verlinde/_index.md b/content/contributors/henk-verlinde/_index.md new file mode 100644 index 0000000..f775534 --- /dev/null +++ b/content/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/docs/_index.md b/content/docs/_index.md index 9921c4b..e74bd7a 100644 --- a/content/docs/_index.md +++ b/content/docs/_index.md @@ -1,8 +1,9 @@ --- title : "Docs" -description: "Docs Doks." +description: "Docs Hyas." lead: "" -date: 2020-04-17T08:48:23+00:00 +date: 2020-10-06T08:48:23+00:00 +lastmod: 2020-10-06T08:48:23+00:00 draft: false -images: [image-doks.png] +images: [] --- diff --git a/content/docs/basic-hyas/_index.md b/content/docs/basic-hyas/_index.md new file mode 100644 index 0000000..f1fb62c --- /dev/null +++ b/content/docs/basic-hyas/_index.md @@ -0,0 +1,9 @@ +--- +title: "Basic Hyas" +description: "Basic Hyas." +lead: "" +date: 2020-04-20T11:52:49+02:00 +lastmod: 2020-04-20T11:52:49+02:00 +draft: false +images: [] +--- diff --git a/content/docs/basic-hyas/archetypes.md b/content/docs/basic-hyas/archetypes.md new file mode 100644 index 0000000..484ef3a --- /dev/null +++ b/content/docs/basic-hyas/archetypes.md @@ -0,0 +1,53 @@ +--- +title: "Archetypes" +description: "" +lead: "" +date: 2020-09-21T13:58:42+02:00 +lastmod: 2020-09-21T13:58:42+02:00 +draft: false +images: [] +menu: + docs: + parent: "basic-hyas" +weight: 130 +toc: true +--- + +```bash +.. +├── blog.md +└── default.md +``` + +See also the Hugo docs: [Archetypes](https://gohugo.io/content-management/archetypes/). + +## blog.md + +```md +--- +title: "{{ replace .Name "-" " " | title }}" +description: "" +excerpt: "" +date: {{ .Date }} +lastmod: {{ .Date }} +draft: true +weight: 50 +images: ["{{ .Name | urlize }}.jpg"] +categories: [""] +--- + +{{}} +``` + +## default.md + +```md +--- +title: "{{ replace .Name "-" " " | title }}" +description: "" +date: {{ .Date }} +lastmod: {{ .Date }} +draft: true +images: [] +--- +``` diff --git a/content/docs/basic-hyas/assets.md b/content/docs/basic-hyas/assets.md new file mode 100644 index 0000000..7ef5e99 --- /dev/null +++ b/content/docs/basic-hyas/assets.md @@ -0,0 +1,32 @@ +--- +title: "Assets" +description: "" +lead: "" +date: 2020-09-21T14:41:53+02:00 +lastmod: 2020-09-21T14:41:53+02:00 +draft: false +images: [] +menu: + docs: + parent: "basic-hyas" +weight: 140 +toc: true +--- + +```bash +.. +├── fonts/ +├── images/ +├── js/ +│ ├── vendor/ +│ └── app.js +├── lambda/ +└── scss/ + ├── common/ + ├── components/ + ├── layouts/ + ├── vendor/ + └── app.scss +``` + +See also the Hugo docs: [Hugo Pipes](https://gohugo.io/hugo-pipes/). diff --git a/content/docs/basic-hyas/deployment.md b/content/docs/basic-hyas/deployment.md new file mode 100644 index 0000000..6c8c95f --- /dev/null +++ b/content/docs/basic-hyas/deployment.md @@ -0,0 +1,34 @@ +--- +title: "Deployment" +description: "Deployment Hyas." +lead: "Hyas is optimized for deployment to Netlify, but you can use any other static web host if you prefer." +date: 2020-04-20T12:46:25+02:00 +lastmod: 2020-04-20T12:46:25+02:00 +draft: false +images: [] +menu: + docs: + parent: "basic-hyas" +weight: 160 +toc: true +--- + +```bash +yarn build +``` + +## Netlify + +See also: [Netlify]({{< ref "netlify" >}}). + +### Netlify Drop + +Netlify Drop lets you deploy a website with simply drag & drop. + +- Run `yarn build` in your project folder. +- This will generate a `public` folder where your generated site is located. +- Visit [Netlify Drop](https://app.netlify.com/drop) and drop the `public` folder there. + +## Other hosting options + +See the Hugo Docs: [Hosting & Deployment](https://gohugo.io/hosting-and-deployment/). diff --git a/content/docs/basic-hyas/directory-structure.md b/content/docs/basic-hyas/directory-structure.md new file mode 100644 index 0000000..57356ff --- /dev/null +++ b/content/docs/basic-hyas/directory-structure.md @@ -0,0 +1,185 @@ +--- +title: "Directory Structure" +description: "The Hyas project directory structure extends Hugo's." +lead: "The Hyas project directory structure extends Hugo's." +date: 2020-04-20T14:14:16+02:00 +lastmod: 2020-04-20T14:14:16+02:00 +draft: false +images: [] +menu: + docs: + parent: "basic-hyas" +weight: 110 +toc: true +--- + +```bash +. +├── archetypes/ +├── assets/ +├── config/ +├── content/ +├── data/ +├── layouts/ +├── static/ +├── .eslintignore +├── .eslintrc.json +├── .markdownlint.json +├── .markdownlintignore +├── .stylelintignore +├── .stylelintrc.json +├── babel.config.js +├── netlify.toml +└── package.json +``` + +See also the Hugo docs: [Directory Structure](https://gohugo.io/getting-started/directory-structure/). + +## Root directories + +### archetypes + +```bash +.. +├── blog.md +└── default.md +``` + +See also: [Archetypes]({{< ref "archetypes" >}}). + +### assets + +```bash +.. +├── fonts/ +├── images/ +├── js/ +│ ├── vendor/ +│ └── app.js +├── lambda/ +└── scss/ + ├── common/ + ├── components/ + ├── layouts/ + ├── vendor/ + └── app.scss +``` + +See also: [Assets]({{< ref "assets" >}}) + +### config + +```bash +.. +├── _default/ +│ ├── config.toml +│ ├── menus.toml +│ └── params.toml +├── production/ +├── staging/ +└── postcss.config.js +``` + +See also: [Project Configuration]({{< ref "project-configuration" >}}). + +### content + +```bash +.. +├── blog/ +├── quick-start/ +└── _index.md +``` + +See also the Hugo docs: [Content Organization](https://gohugo.io/content-management/organization/). + +### data + +See the Hugo docs: [Data Templates](https://gohugo.io/templates/data-templates/). + +### layouts + +```bash +.. +├── _default/ +│ ├── baseof.html +│ ├── list.html +│ └── single.html +├── blog/ +│ └── single.html +├── categories/ +│ ├── list.html +│ └── terms.html +├── partials/ +│ ├── content/ +│ ├── footer/ +│ │ ├── footer.html +│ │ └── script-footer.html +│ ├── head/ +│ │ ├── favicons.html +│ │ ├── head.html +│ │ ├── opengraph.html +│ │ ├── resource-hints.html +│ │ ├── script-header.html +│ │ ├── seo.html +│ │ ├── structured-data.html +│ │ ├── stylesheet.html +│ │ └── twitter_cards.html +│ ├── header/ +│ │ ├── alert.html +│ │ └── header.html +│ └── sidebar/ +├── shortcodes/ +│ └── img.html +├── 404.html +├── index.headers +├── index.html +├── index.redirects +├── robots.txt +├── rss.xml +└── sitemap.xml +``` + +See also: [Layouts]({{< ref "layouts" >}}). + +### static + +See the Hugo docs: [Static Files](https://gohugo.io/content-management/static-files/) + +## Root files + +### .eslintignore + +See the ESLint docs: [Ignoring Files and Directories](https://eslint.org/docs/user-guide/configuring#ignoring-files-and-directories). + +### .eslintrc.json + +See the ESLint docs: [Configuring ESLint](https://eslint.org/docs/user-guide/configuring). + +### .markdownlint.json + +See the markdownlint Readme: [Rules / Aliases](https://github.com/DavidAnson/markdownlint#rules--aliases). + +### .markdownlintignore + +See the markdownlint-cli Readme: [Ignoring Files](https://github.com/igorshubovych/markdownlint-cli#ignoring-files). + +### .stylelintignore + +See the stylelint docs: [Ignoring code](https://stylelint.io/user-guide/ignore-code). + +### .stylelintrc.json + +See the stylelint docs: [Configuration](https://stylelint.io/user-guide/configure). + +### babel.config.js + +See the Babel docs: [Configure Babel](https://babeljs.io/docs/en/configuration). + +### netlify.toml + +See the Netlify docs: [File-based configuration](https://docs.netlify.com/configure-builds/file-based-configuration/). + +### package.json + +See the Yarn Documentation: [package.json](https://classic.yarnpkg.com/en/docs/package-json/). diff --git a/content/docs/basic-hyas/layouts.md b/content/docs/basic-hyas/layouts.md new file mode 100644 index 0000000..25af8c7 --- /dev/null +++ b/content/docs/basic-hyas/layouts.md @@ -0,0 +1,57 @@ +--- +title: "Layouts" +description: "" +lead: "" +date: 2020-09-21T14:13:01+02:00 +lastmod: 2020-09-21T14:13:01+02:00 +draft: false +images: [] +menu: + docs: + parent: "basic-hyas" +weight: 150 +toc: true +--- + +```bash +.. +├── _default/ +│ ├── baseof.html +│ ├── list.html +│ └── single.html +├── blog/ +│ └── single.html +├── categories/ +│ ├── list.html +│ └── terms.html +├── partials/ +│ ├── content/ +│ ├── footer/ +│ │ ├── footer.html +│ │ └── script-footer.html +│ ├── head/ +│ │ ├── favicons.html +│ │ ├── head.html +│ │ ├── opengraph.html +│ │ ├── resource-hints.html +│ │ ├── script-header.html +│ │ ├── seo.html +│ │ ├── structured-data.html +│ │ ├── stylesheet.html +│ │ └── twitter_cards.html +│ ├── header/ +│ │ ├── alert.html +│ │ └── header.html +│ └── sidebar/ +├── shortcodes/ +│ └── img.html +├── 404.html +├── index.headers +├── index.html +├── index.redirects +├── robots.txt +├── rss.xml +└── sitemap.xml +``` + +See also the Hugo docs: [Templates](https://gohugo.io/templates/). diff --git a/content/docs/basic-hyas/project-configuration.md b/content/docs/basic-hyas/project-configuration.md new file mode 100644 index 0000000..d0ac1c8 --- /dev/null +++ b/content/docs/basic-hyas/project-configuration.md @@ -0,0 +1,142 @@ +--- +title: "Project Configuration" +description: "The Hyas project configuration extends Hugo's." +lead: "The Hyas project configuration extends Hugo's." +date: 2020-09-21T12:19:02+02:00 +lastmod: 2020-09-21T12:19:02+02:00 +draft: false +images: [] +menu: + docs: + parent: "basic-hyas" +weight: 120 +toc: true +--- + +```bash +.. +├── _default/ +│ ├── config.toml +│ ├── menus.toml +│ └── params.toml +├── production/ +├── staging/ +└── postcss.config.js +``` + +See also the Hugo docs: [Configure Hugo](https://gohugo.io/getting-started/configuration/). + +## config.toml + +### Netlify specifics + +```toml +# add redirects/headers +[outputs] +home = ["HTML", "RSS", "REDIRECTS", "HEADERS"] + +# remove .{ext} from text/netlify +[mediaTypes."text/netlify"] +suffixes = [""] +delimiter = "" + +# add output format for netlify _redirects +[outputFormats.REDIRECTS] +mediatype = "text/netlify" +baseName = "_redirects" +isPlainText = true +notAlternative = true + +# add output format for netlify _headers +[outputFormats.HEADERS] +mediatype = "text/netlify" +baseName = "_headers" +isPlainText = true +notAlternative = true +``` + +## menus.toml + +No specifics. + +## params.toml + +### SEO specifics + +```toml +title = "Hyas" +titleSeparator = "-" +titleAddition = "Modern Hugo Starter" +description = "Hugo starter helping you build modern websites." + +images = ["hyas.png"] + +twitterSite = "@henkverlinde" +twitterCreator = "@henkverlinde" +facebookAuthor = "verlinde.henk" +facebookPublisher = "verlinde.henk" +ogLocale = "en_US" + +schemaType = "Organization" +schemaLogo = "logo-hyas.png" +schemaTwitter = "https://twitter.com/henkverlinde" +schemaLinkedIn = "https://www.linkedin.com/in/henkverlinde/" +schemaGitHub = "https://github.com/h-enk" +schemaSection = "blog" + +siteLinksSearchBox = false + +themeColor = "#fff" +``` + +### Image shortcode + +```toml +quality = 85 +bgColor = "#fff" +landscapePhotoWidths = [1000, 800, 700, 600, 500] +portraitPhotoWidths = [800, 700, 600, 500] +lqipWidth = "20x" +``` + +### Footer + +```toml +footer = "© 2020 Henk Verlinde - MIT License" +``` + +### Alert + +```toml +alert = false +alertText = "Deliver web projects 10x faster. Get the free enterprise paper →" +``` + +## postcss.config.js + +```js +const autoprefixer = require('autoprefixer'); +const purgecss = require('@fullhuman/postcss-purgecss'); +const whitelister = require('purgecss-whitelister'); + +module.exports = { + plugins: [ + autoprefixer(), + purgecss({ + content: [ + './layouts/**/*.html', + './content/**/*.md', + ], + whitelist: [ + 'lazyloaded', + ...whitelister([ + './assets/scss/components/_syntax.scss', + './assets/scss/components/_code.scss', + ]), + ], + }), + ], +} +``` + +See also: [Unused CSS removal]({{< ref "performance#unused-css-removal" >}}). diff --git a/content/docs/core-hyas/_index.md b/content/docs/core-hyas/_index.md new file mode 100644 index 0000000..8e44b9b --- /dev/null +++ b/content/docs/core-hyas/_index.md @@ -0,0 +1,9 @@ +--- +title: "Assets" +description: "Assets Hyas." +lead: "" +date: 2020-04-20T11:52:58+02:00 +lastmod: 2020-04-20T11:52:58+02:00 +draft: false +images: [] +--- diff --git a/content/docs/core-hyas/bootstrap.md b/content/docs/core-hyas/bootstrap.md new file mode 100644 index 0000000..ccc21c1 --- /dev/null +++ b/content/docs/core-hyas/bootstrap.md @@ -0,0 +1,15 @@ +--- +title: "Bootstrap" +description: "Build robust, flexible, and intuitive websites with Bootstrap. Or use any other front-end framework if you prefer." +lead: "Build robust, flexible, and intuitive websites with Bootstrap. Or use any other front-end framework if you prefer." +date: 2020-09-21T16:00:43+02:00 +lastmod: 2020-09-21T16:00:43+02:00 +draft: false +images: [] +menu: + docs: + parent: "core-hyas" +weight: 250 +toc: true +--- + diff --git a/content/docs/core-hyas/development-tools.md b/content/docs/core-hyas/development-tools.md new file mode 100644 index 0000000..701db38 --- /dev/null +++ b/content/docs/core-hyas/development-tools.md @@ -0,0 +1,15 @@ +--- +title: "Development Tools" +description: "Code with confidence. Check styles, scripts, and markdown for errors and fix automatically or manually." +lead: "Code with confidence. Check styles, scripts, and markdown for errors and fix automatically or manually." +date: 2020-09-21T14:26:38+02:00 +lastmod: 2020-09-21T14:26:38+02:00 +draft: false +images: [] +menu: + docs: + parent: "core-hyas" +weight: 240 +toc: true +--- + diff --git a/content/docs/core-hyas/netlify.md b/content/docs/core-hyas/netlify.md new file mode 100644 index 0000000..1c43e02 --- /dev/null +++ b/content/docs/core-hyas/netlify.md @@ -0,0 +1,91 @@ +--- +title: "Netlify" +description: "Deploy to Netlify with sensible defaults. Easily use Netlify Functions, Netlify Redirects, and Netlify Headers." +lead: "Deploy to Netlify with sensible defaults. Easily use Netlify Functions, Netlify Redirects, and Netlify Headers." +date: 2020-09-21T15:58:12+02:00 +lastmod: 2020-09-21T15:58:12+02:00 +draft: false +images: [] +menu: + docs: + parent: "core-hyas" +weight: 260 +toc: true +--- + +```bash +. +├── assets/ +│ └── lambda/ +├── layouts/ +│ ├── index.headers +│ └── index.redirects +└── netlify.toml +``` + +See also the Hugo Docs: [Host on Netlify](https://gohugo.io/hosting-and-deployment/hosting-on-netlify/). + +## Functions + +Functions in `./assets/lambda/` are compiled on build to `./functions/`. + +See also the Netlify docs: [Functions overview](https://docs.netlify.com/functions/overview/) + +## Redirects + +`./layouts/index.redirects` is converted on build to `./public/_redirects`. + +```bash +{{ range $pages := .Site.Pages -}} + {{ range .Aliases -}} + {{ . }} {{ $pages.RelPermalink -}} + {{ end -}} +{{ end -}} +``` + +See also the Netlify docs: [Redirects and rewrites](https://docs.netlify.com/routing/redirects/) + +## Headers + +`./layouts/index.headers` is converted on build to `./public/_headers`. + +```bash +/* + Strict-Transport-Security: max-age=31536000; includeSubDomains; preload + X-Content-Type-Options: nosniff + X-XSS-Protection: 1; mode=block + Content-Security-Policy: default-src 'none'; manifest-src 'self'; connect-src 'self'; font-src 'self'; img-src 'self'; script-src 'self'; style-src 'self' + X-Frame-Options: SAMEORIGIN + Referrer-Policy: strict-origin + Feature-Policy: geolocation 'self' + Cache-Control: public, max-age=31536000 +``` + +See also the Netlify docs: [Custom headers](https://docs.netlify.com/routing/headers/) + +## Build and deploy + +`./netlify.toml`: + +```toml +[build] + publish = "public" + functions = "functions" + +[build.environment] + HUGO_VERSION = "0.74.3" + NODE_VERSION = "13.11.0" + NPM_VERSION = "6.13.7" + YARN_VERSION = "1.22.4" + +[context.production] + command = "hugo -b $URL --gc --minify && npm run build:functions" + +[context.deploy-preview] + command = "hugo -b $DEPLOY_PRIME_URL --gc --minify" + +[context.branch-deploy] + command = "hugo -b $DEPLOY_PRIME_URL --gc --minify" +``` + +See also the Netlify docs: [File-based configuration](https://docs.netlify.com/configure-builds/file-based-configuration/) diff --git a/content/docs/core-hyas/performance.md b/content/docs/core-hyas/performance.md new file mode 100644 index 0000000..3d88fdc --- /dev/null +++ b/content/docs/core-hyas/performance.md @@ -0,0 +1,61 @@ +--- +title: "Performance" +description: "Get 100 scores on Google Lighthouse by default. Hyas removes unused css, prefetches links, and lazy loads images." +lead: "Get 100 scores on Google Lighthouse by default. Hyas removes unused css, prefetches links, and lazy loads images." +date: 2020-09-17T15:37:44+02:00 +lastmod: 2020-09-17T15:37:44+02:00 +draft: false +images: [] +menu: + docs: + parent: "core-hyas" +weight: 220 +toc: true +--- + +## Unused CSS removal + +`./config/postcss.config.js`: + +```js +const autoprefixer = require('autoprefixer'); +const purgecss = require('@fullhuman/postcss-purgecss'); +const whitelister = require('purgecss-whitelister'); + +module.exports = { + plugins: [ + autoprefixer(), + purgecss({ + content: [ + './layouts/**/*.html', + './content/**/*.md', + ], + whitelist: [ + 'lazyloaded', + ...whitelister([ + './assets/scss/components/_syntax.scss', + './assets/scss/components/_code.scss', + ]), + ], + }), + ], +} +``` + +See also the PurgeCSS docs: [Configuration](https://purgecss.com/configuration.html), and the Purgecss Whitelister [Readme](https://github.com/qodesmith/purgecss-whitelister#readme). + +## Asset minification + +Hyas uses [Hugo](https://gohugo.io/hugo-pipes/minification/) to minify CSS, JS and HTML. + +## Link prefetching + +Hyas uses [instant.page](https://instant.page/) with default settings for link prefetching. By default, instant.page preloads 65 ms after hovering a link and when a mobile user starts touching their display. + +See also the instant.page website: [Intensity](https://instant.page/intensity). + +## Lazy loading images + +Hyas uses [lazysizes](https://github.com/aFarkas/lazysizes) with a Low Quality Image Placeholder (LQIP) to lazyload images added with the [image shortcode]({{< ref "layouts" >}}). The LQIP is blurred with a CSS filter. + +See also the lazysizes [Readme](https://github.com/aFarkas/lazysizes#readme) diff --git a/content/docs/core-hyas/security.md b/content/docs/core-hyas/security.md new file mode 100644 index 0000000..e115827 --- /dev/null +++ b/content/docs/core-hyas/security.md @@ -0,0 +1,37 @@ +--- +title: "Security" +description: "Get A+ scores on Mozilla Observatory out of the box. Easily change the default Security Headers to suit your needs." +lead: "Get A+ scores on Mozilla Observatory out of the box. Easily change the default Security Headers to suit your needs." +date: 2020-09-17T13:48:09+02:00 +lastmod: 2020-09-17T13:48:09+02:00 +draft: false +images: [] +menu: + docs: + parent: "core-hyas" +weight: 210 +toc: true +--- + +## Security Headers + +`./layouts/index.headers` excerpt: + +```bash +/* + X-Content-Type-Options: nosniff + X-XSS-Protection: 1; mode=block + Content-Security-Policy: default-src 'none'; manifest-src 'self'; connect-src 'self'; font-src 'self'; img-src 'self'; script-src 'self'; style-src 'self' + X-Frame-Options: SAMEORIGIN + Referrer-Policy: strict-origin +``` + +See also: [Headers]({{< ref "netlify#headers" >}}). + +### Content Security Policy + +💡 [Laboratory](https://addons.mozilla.org/nl/firefox/addon/laboratory-by-mozilla/) is an experimental Firefox extension that helps you generate a Content Security Policy (CSP) header for your website. + +## Subresource Integrity + +[Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) is implemented with [Hugo](https://gohugo.io/hugo-pipes/fingerprint/) on styles and scripts. diff --git a/content/docs/core-hyas/seo.md b/content/docs/core-hyas/seo.md new file mode 100644 index 0000000..68862d7 --- /dev/null +++ b/content/docs/core-hyas/seo.md @@ -0,0 +1,15 @@ +--- +title: "SEO" +description: "Use sensible defaults for structured data, open graph, and Twitter cards. Or easily change the SEO settings to your liking." +lead: "Use sensible defaults for structured data, open graph, and Twitter cards. Or easily change the SEO settings to your liking." +date: 2020-09-18T14:25:19+02:00 +lastmod: 2020-09-18T14:25:19+02:00 +draft: false +images: [] +menu: + docs: + parent: "core-hyas" +weight: 230 +toc: true +--- + diff --git a/content/docs/guides/_index.md b/content/docs/guides/_index.md new file mode 100644 index 0000000..e9f52c0 --- /dev/null +++ b/content/docs/guides/_index.md @@ -0,0 +1,9 @@ +--- +title: "Guides" +description: "Guides Hyas" +lead: "" +date: 2020-04-20T11:53:07+02:00 +lastmod: 2020-04-20T11:53:07+02:00 +draft: false +images: [] +--- diff --git a/content/docs/guides/add-custom-fonts.md b/content/docs/guides/add-custom-fonts.md new file mode 100644 index 0000000..76a45dd --- /dev/null +++ b/content/docs/guides/add-custom-fonts.md @@ -0,0 +1,15 @@ +--- +title: "Add Custom Fonts" +description: "" +lead: "" +date: 2020-09-21T14:28:38+02:00 +lastmod: 2020-09-21T14:28:38+02:00 +draft: false +images: [] +menu: + docs: + parent: "guides" +weight: 310 +toc: true +--- + diff --git a/content/docs/guides/add-external-scripts.md b/content/docs/guides/add-external-scripts.md new file mode 100644 index 0000000..720b189 --- /dev/null +++ b/content/docs/guides/add-external-scripts.md @@ -0,0 +1,15 @@ +--- +title: "Add External Scripts" +description: "" +lead: "" +date: 2020-09-21T14:28:51+02:00 +lastmod: 2020-09-21T14:28:51+02:00 +draft: false +images: [] +menu: + docs: + parent: "guides" +weight: 320 +toc: true +--- + diff --git a/content/docs/help/_index.md b/content/docs/help/_index.md index 786f8dc..145bd7c 100644 --- a/content/docs/help/_index.md +++ b/content/docs/help/_index.md @@ -1,8 +1,9 @@ --- title: "Help" -description: "Help Doks." +description: "Help Hyas." lead: "" -date: 2020-04-17T08:49:15+00:00 +date: 2020-10-06T08:49:15+00:00 +lastmod: 2020-10-06T08:49:15+00:00 draft: false -images: [image-doks.png] +images: [] --- diff --git a/content/docs/help/faq.md b/content/docs/help/faq.md index 4b29870..6d76ec6 100644 --- a/content/docs/help/faq.md +++ b/content/docs/help/faq.md @@ -1,22 +1,30 @@ --- title: "FAQ" -description: "FAQ Doks." +description: "FAQ Hyas." lead: "" -date: 2020-04-17T08:49:31+00:00 +date: 2020-10-06T08:49:31+00:00 +lastmod: 2020-10-06T08:49:31+00:00 draft: false -images: [image-doks.png] +images: [] menu: docs: parent: "help" -weight: 110 +weight: 410 toc: true --- -## Where to start from here? -Please make sure to check out the documentation: -- [Hugo](https://gohugo.io/documentation/) -- [Hyas](https://gethyas.com/) -- [Doks](https://getdoks.org/) +## What's with the name? + +Hyas used [Atlas](https://github.com/indigotree/atlas) 🙏 as a starting point. In Greek mythology, +[Hyas](https://www.greekmythology.com/Other_Gods/Minor_Gods/Hyas/hyas.html) was the son of the Titan Atlas and the Oceanid Aethra. ## Can I get support? -Visit [Hugo Discourse](https://discourse.gohugo.io/) and use the search. It that does not help, start a new topic and ask your questions. + +Visit [Hugo Discourse](https://discourse.gohugo.io/) and use the search. If that does not help, start a new topic and ask your question. + +## Keyboard shortcuts for search? + +- focus: `/` +- select: `↓` and `↑` +- open: `Enter` +- close: `Esc` diff --git a/content/docs/prologue/_index.md b/content/docs/prologue/_index.md index 262b83e..9abc943 100644 --- a/content/docs/prologue/_index.md +++ b/content/docs/prologue/_index.md @@ -1,8 +1,9 @@ --- title : "Prologue" -description: "Prologue Doks." +description: "Prologue Hyas." lead: "" -date: 2020-04-17T08:48:45+00:00 +date: 2020-10-06T08:48:45+00:00 +lastmod: 2020-10-06T08:48:45+00:00 draft: false -images: [image-doks.png] +images: [] --- diff --git a/content/docs/prologue/commands.md b/content/docs/prologue/commands.md new file mode 100644 index 0000000..e309e63 --- /dev/null +++ b/content/docs/prologue/commands.md @@ -0,0 +1,92 @@ +--- +title: "Commands" +description: "Repository commands." +lead: "Repository commands." +date: 2020-10-13T15:21:01+02:00 +lastmod: 2020-10-13T15:21:01+02:00 +draft: false +images: [] +menu: + docs: + parent: "prologue" +weight: 030 +toc: true +--- + +## start + +Start local development server: + +```bash +yarn start +``` + +## build + +Build production website: + +```bash +yarn build +``` + +### :functions + +```bash +yarn build:functions +``` + +### :preview + +```bash +yarn build:preview +``` + +## server + +Start local development server: + +```bash +yarn server +``` + +## clean + +Delete temporary directories: + +```bash +yarn clean +``` + +## lint + +Check scripts, styles, and markdown for errors: + +```bash +yarn lint +``` + +### :scripts + +```bash +yarn lint:scripts [--fix] +``` + +### :styles + +```bash +yarn lint:styles [--fix] +``` + +### :markdown + +```bash +yarn lint:markdown [--fix] +``` + +## test + +Check scripts, styles, and markdown for errors: + +```bash +yarn test +``` diff --git a/content/docs/prologue/hyas-cli.md b/content/docs/prologue/hyas-cli.md new file mode 100644 index 0000000..d6c5045 --- /dev/null +++ b/content/docs/prologue/hyas-cli.md @@ -0,0 +1,103 @@ +--- +title: "Hyas CLI" +description: "Hyas command line tool." +lead: "Hyas command line tool." +date: 2020-09-22T08:38:48+02:00 +lastmod: 2020-09-22T08:38:48+02:00 +draft: false +images: [] +menu: + docs: + parent: "prologue" +weight: 020 +toc: true +--- + +```bash +Usage: hyas [options] + +Commands: + build Build production website + clean Delete temporary directories + create [dir] Create a new Hyas project + start Start local development server + +Options: + -h, --help Show help [boolean] + -v, --version Show version number [boolean] + +Run hyas --help for detailed usage of given command. +``` + +## Installation + +Install the [Hyas CLI](https://www.npmjs.com/package/@hyas/cli) globally: + +```bash +yarn add global @hyas/cli +``` + +```bash +npm install -g @hyas/cli +``` + +## npx + +Or use [npx](https://nodejs.dev/learn/the-npx-nodejs-package-runner): + +```bash +npx @hyas/cli [options] +``` + +## Commands + +### Create + +Create a new Hyas project: + +```bash +hyas create [dir] +``` + +### Start + +Start local development server: + +```bash +hyas start +``` + +### Build + +Build production website: + +```bash +hyas build +``` + +### Clean + +Delete temporary directories: + +```bash +hyas clean +``` + +## Options + +### -h, --help + +Show help. + +### -v, --version + +Show version number. + +## Update + +You'll get notified when an update is available: + +```bash +Update available: 0.3.2 +Run npm install -g @hyas/cli to update +``` diff --git a/content/docs/prologue/introduction.md b/content/docs/prologue/introduction.md index b4fc188..6cc33e8 100644 --- a/content/docs/prologue/introduction.md +++ b/content/docs/prologue/introduction.md @@ -1,10 +1,11 @@ --- title: "Introduction" -description: "Introduction Doks." -lead: "Doks is a Hugo starter helping you build modern documentation websites." -date: 2020-04-17T08:48:57+00:00 +description: "Introduction Hyas." +lead: "Hyas is a Hugo starter helping you build modern websites that are secure, fast, and SEO-ready — by default." +date: 2020-10-06T08:48:57+00:00 +lastmod: 2020-10-06T08:48:57+00:00 draft: false -images: [image-doks.png] +images: [] menu: docs: parent: "prologue" @@ -12,55 +13,92 @@ weight: 010 toc: true --- -## Features -- Lightweight code base -- 100 scores Google Lighthouse -- A+ scores [Mozilla Observatory](https://observatory.mozilla.org/) -- [Algolia DocSearch](https://docsearch.algolia.com/) support -- Dark/Light toggle -- Blog ready -- Easily make it your own -- All in [Hyas](https://github.com/h-enk/hyas) +## Why Hyas? -See a working example at [doks.netlify.app](https://doks.netlify.app/) +Six reasons why you should use Hyas: -## Requirements +1. __Security aware__. Get A+ scores on [Mozilla Observatory](https://observatory.mozilla.org/analyze/hyas.netlify.app) out of the box. Easily change the default Security Headers to suit your needs. + +2. __Fast by default__. Get 100 scores on [Google Lighthouse](https://googlechrome.github.io/lighthouse/viewer/?gist=8b7aec005ae7b9e128ad5c4e2f125fea) by default. Hyas removes unused css, prefetches links, and lazy loads images. + +3. __SEO-ready__. Use sensible defaults for structured data, open graph, and Twitter cards. Or easily change the SEO settings to your liking. + +4. __Development tools__. Code with confidence. Check styles, scripts, and markdown for errors and fix automatically or manually. + +5. __Bootstrap framework__. Build robust, flexible, and intuitive websites with Bootstrap. Or use any other front-end framework if you prefer. + +6. __Netlify-ready__. Deploy to Netlify with sensible defaults. Easily use Netlify Functions, Netlify Redirects, and Netlify Headers. + +## Prerequisites Make sure all dependencies have been installed: -- [Hugo](https://gohugo.io/) >= 0.69.0/extended -- [Node.js](https://nodejs.org/) >= 13.11.0 -- [Yarn](https://yarnpkg.com/) >= 1.22.4 (recommended) +- [Hugo](https://gohugo.io/) >= 0.75.1/extended +- [Node.js](https://nodejs.org/) >= 14.12.0 +- [Yarn](https://yarnpkg.com/) >= 1.22.5 (recommended) + +{{< alert icon="💡" text="npm (comes with Node.js) and Yarn are both Node.js package managers. Yarn is faster, more reliable, and more secure than npm." >}} ## Get started -Create a new Doks project: +Three ways to get started. + +### Hyas CLI + +Install the Hyas CLI globally: ```bash -$ git clone git@github.com:h-enk/doks.git my-doks-site +yarn add global @hyas/cli +``` + +Create a new Hyas project: + +```bash +hyas create [dir] +``` + +#### npx + +Or use [npx](https://nodejs.dev/learn/the-npx-nodejs-package-runner): + +```bash +npx @hyas/cli create my-hyas-site +``` + +See also: [Hyas CLI]({{< ref "hyas-cli" >}}). + +### Repository clone + +Create a new Hyas project: + +```bash +git clone git@github.com:h-enk/hyas.git my-hyas-site ``` Install dependencies: ```bash -# @ my-doks-site/ -$ yarn install +yarn install ``` -Build development theme with live reloading and injection: +Start local development server: ```bash -# @ my-doks-site/ -$ yarn start +yarn start ``` -### Other commands -- `yarn lint:styles` - Check Sass for errors -- `yarn lint:scripts` - Check JavaScript for errors -- `yarn clean` - Delete temporary directories -- `yarn build` - Build production theme +See also: [commands]({{< ref "commands" >}}). -## Documentation -- [Hugo](https://gohugo.io/documentation/) -- [Hyas](https://gethyas.com/) -- [Doks](https://getdoks.org/) +### Netlify deploy + +Get your Hyas site in 1 min. + +Deploy to Netlify + + + +## Example site + +👉 [hyas.netlify.app](https://hyas.netlify.app/) diff --git a/content/privacy-policy/index.md b/content/privacy-policy/index.md new file mode 100644 index 0000000..9ed6794 --- /dev/null +++ b/content/privacy-policy/index.md @@ -0,0 +1,36 @@ +--- +title: "Privacy Policy" +description: "Privacy Policy gethyas.com" +date: 2020-08-27T19:23:18+02:00 +lastmod: 2020-08-27T19:23:18+02:00 +draft: true +images: [] +--- + +__TLDR__: I do not use cookies and I 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 I collect and what I use it for + +I run [Plausible](https://plausible.io/) analytics on gethyas.com. The following information is collected: + +- __Page URL__. I track the page URL of each page view on this website. I use this to understand which pages have been viewed and how many times a particular page has been viewed. For example: _https://gethyas.com/_. +- __HTTP Referrer__. I 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__. I 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__. I use this to understand what operating systems people use when visiting this website. I 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__. I 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__. I look up the visitor’s country using the IP address. I do not track anything more granular than the country of origin and the IP address of the visitor is discarded. I never store IP addresses in my database or logs. For example: _Canada_. + +## Contact me + +[Contact me]({{< ref "contact/index.md" >}}) if you have any questions. + +Effective Date: _20th July 2020_ diff --git a/layouts/404.html b/layouts/404.html index 12063f3..f1fe6bf 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -2,8 +2,8 @@
-

Page not found

-

The page you requested could not be found.

+

Page not found :(

+

The page you are looking for doesn't exist or has been moved.

diff --git a/layouts/_default/_markup/.gitkeep b/layouts/_default/_markup/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html deleted file mode 100644 index 95e0be2..0000000 --- a/layouts/_default/_markup/render-link.html +++ /dev/null @@ -1 +0,0 @@ -{{ .Text | safeHTML }} \ No newline at end of file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 3dea403..e5b2257 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,6 +1,6 @@ - {{ block "head" . }}{{ partial "head/head.html" . }}{{ end }} + {{ partial "head/head.html" . }} {{ if eq .Kind "home" -}} {{ .Scratch.Set "class" "home" -}} {{ else if eq .Kind "404" -}} @@ -13,15 +13,18 @@ {{ .Scratch.Add "class" " list" -}} {{ end -}} - {{ block "header" . }}{{ partial "header/header.html" . }}{{ end }} + {{ partial "header/header.html" . }}
{{ block "main" . }}{{ end }}
- {{ if ne .Section "docs" }} - {{ block "footer" . }}{{ partial "footer/footer.html" . }}{{ end }} + {{ block "sidebar-prefooter" . }}{{ end }} + {{ block "sidebar-footer" . }}{{ end }} + {{ partial "footer/footer.html" . }} + {{ if and .IsHome .Site.Params.alert }} + {{ partial "footer/alert.html" . }} {{ end }} - {{ block "script-footer" . }}{{ partial "footer/script-footer.html" . }}{{ end }} + {{ partial "footer/script-footer.html" . }} \ No newline at end of file diff --git a/layouts/_default/index.js b/layouts/_default/index.js new file mode 100644 index 0000000..2dd84f7 --- /dev/null +++ b/layouts/_default/index.js @@ -0,0 +1,10 @@ +var docs = [ +{{ range $index, $page := (where .Site.Pages "Section" "docs") -}} + { + id: {{ $index }}, + title: "{{ .Title }}", + description: "{{ .Params.description }}", + href: "{{ .URL | absURL }}" + }, +{{ end -}} +]; \ No newline at end of file diff --git a/layouts/_default/index.json b/layouts/_default/index.json new file mode 100644 index 0000000..b1997c8 --- /dev/null +++ b/layouts/_default/index.json @@ -0,0 +1,5 @@ +{{- $.Scratch.Add "index" slice -}} +{{- range .Site.RegularPages -}} + {{- $.Scratch.Add "index" (dict "title" .Title "description" .Params.description "contents" .Plain "permalink" .Permalink) -}} +{{- end -}} +{{- $.Scratch.Get "index" | jsonify -}} \ No newline at end of file diff --git a/layouts/_default/section.sitemap.xml b/layouts/_default/section.sitemap.xml new file mode 100644 index 0000000..701951d --- /dev/null +++ b/layouts/_default/section.sitemap.xml @@ -0,0 +1,46 @@ +{{ printf "" | safeHTML -}} + + {{ range $i, $e := .Data.Pages -}} + {{ if ne .Params.sitemap_exclude true }} + + {{ .Permalink }}{{ if not .Lastmod.IsZero }} + {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}{{ end }}{{ with .Sitemap.ChangeFreq }} + {{ . }}{{ end }}{{ if ge .Sitemap.Priority 0.0 }} + {{ .Sitemap.Priority }}{{ end }}{{ if .IsTranslated }}{{ range .Translations }} + {{ end }} + {{ end }} + + {{ end -}} + {{ end -}} + {{ range .Sections -}} + {{ range $i, $e := .Data.Pages -}} + {{ if ne .Params.sitemap_exclude true -}} + + {{ .Permalink }}{{ if not .Lastmod.IsZero }} + {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}{{ end }}{{ with .Sitemap.ChangeFreq }} + {{ . }}{{ end }}{{ if ge .Sitemap.Priority 0.0 }} + {{ .Sitemap.Priority }}{{ end }}{{ if .IsTranslated }}{{ range .Translations }} + {{ end }} + {{ end }} + + {{ end -}} + {{ end -}} + {{ end -}} + \ No newline at end of file diff --git a/layouts/blog/list.html b/layouts/blog/list.html index fa1ff87..b5fe8ca 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/list.html @@ -8,8 +8,8 @@ {{ range .Data.Pages -}}
-

{{ .Params.title }}

-

{{ .Params.lead }}

+

{{ .Params.title }}

+

{{ .Params.lead | safeHTML }}

{{ partial "main/blog-meta.html" . -}}
diff --git a/layouts/blog/single.html b/layouts/blog/single.html index bb2c902..48fdb82 100644 --- a/layouts/blog/single.html +++ b/layouts/blog/single.html @@ -6,7 +6,7 @@

{{ .Title }}

{{ partial "main/blog-meta.html" . }} -

{{ .Params.lead }}

+

{{ .Params.lead | safeHTML }}

{{ .Content }} diff --git a/layouts/authors/list.html b/layouts/contributors/list.html similarity index 75% rename from layouts/authors/list.html rename to layouts/contributors/list.html index 5752bae..45e07e6 100644 --- a/layouts/authors/list.html +++ b/layouts/contributors/list.html @@ -8,9 +8,9 @@ {{ range .Data.Pages -}}
-

{{ .Params.title }}

+

{{ .Params.title }}

{{ if eq .Section "blog" -}} -

{{ .Params.lead }}

+

{{ .Params.lead | safeHTML }}

{{ partial "main/blog-meta.html" . -}} {{ end -}}
diff --git a/layouts/docs/single.html b/layouts/docs/single.html index d212753..59d045a 100644 --- a/layouts/docs/single.html +++ b/layouts/docs/single.html @@ -12,6 +12,7 @@

{{ .Title }}

{{ .Params.lead | safeHTML }}

{{ partial "main/headline-hash.html" .Content }} + {{ partial "main/edit-page.html" . }} {{ partial "main/docs-navigation.html" . }}
diff --git a/layouts/index.headers b/layouts/index.headers index 385e241..3716436 100644 --- a/layouts/index.headers +++ b/layouts/index.headers @@ -2,7 +2,7 @@ Strict-Transport-Security: max-age=31536000; includeSubDomains; preload X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block - Content-Security-Policy: default-src 'self'; img-src 'self' data:; script-src 'self'; style-src 'self' + Content-Security-Policy: default-src 'self'; manifest-src 'self'; connect-src 'self' https://stats.gethyas.com https://*.algolia.net https://*.algolianet.com https://*.algolia.io; font-src 'self'; img-src 'self' data: https://www.netlify.com; script-src 'self' 'unsafe-eval' 'nonce-dXNlcj0iaGVsbG8iLGRvbWFpbj0iaGVua3ZlcmxpbmRlLmNvbSIsZG9jdW1lbnQud3JpdGUodXNlcisiQCIrZG9tYWluKTs=' https://stats.gethyas.com; style-src 'self' X-Frame-Options: SAMEORIGIN Referrer-Policy: strict-origin Feature-Policy: geolocation 'self' diff --git a/layouts/index.html b/layouts/index.html index b0550ee..4c1602f 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,15 +1,128 @@ {{ define "main" }}
-
+

{{ .Title }}

{{ .Params.Lead | safeHTML }}

- Get started -

{{ .Site.Params.version }}

+ Get started +

Open-source MIT Licensed. GitHub {{ .Site.Params.hyasVersion }}

-
- {{- .Content -}} +{{ end }} + +{{ define "sidebar-prefooter" }} + +{{ end }} + +{{ define "sidebar-footer" }} + +{{ end }} diff --git a/layouts/partials/footer/alert.html b/layouts/partials/footer/alert.html new file mode 100644 index 0000000..84d6423 --- /dev/null +++ b/layouts/partials/footer/alert.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/layouts/partials/footer/footer.html b/layouts/partials/footer/footer.html index c17c474..adfe715 100644 --- a/layouts/partials/footer/footer.html +++ b/layouts/partials/footer/footer.html @@ -2,7 +2,12 @@
-

{{ .Site.Params.footer | safeHTML }}

+
    + + +
  • This site is powered by Hugo and the Doks theme
  • + +
diff --git a/layouts/partials/footer/script-footer.html b/layouts/partials/footer/script-footer.html index b61fe0b..0d1f316 100644 --- a/layouts/partials/footer/script-footer.html +++ b/layouts/partials/footer/script-footer.html @@ -1,11 +1,18 @@ +{{ $indexTemplate := resources.Get "js/index.js" -}} +{{ $index := $indexTemplate | resources.ExecuteAsTemplate "index.js" . -}} {{ $lazysizes := resources.Get "js/vendor/lazysizes/lazysizes.min.js" -}} +{{ $flexsearch := resources.Get "js/vendor/flexsearch/dist/flexsearch.min.js" -}} {{ if eq (hugo.Environment) "development" -}} {{ $app := resources.Get "js/app.js" -}} - {{ $js := slice $lazysizes $app | resources.Concat "main.js" -}} + {{ $js := slice $lazysizes $flexsearch $app | resources.Concat "main.js" -}} + {{ else -}} + {{ $instantPage := resources.Get "js/vendor/instant.page/instantpage.js" | minify -}} {{ $app := resources.Get "js/app.js" | minify -}} - {{ $js := slice $lazysizes $app | resources.Concat "main.js" -}} - {{ $secureJS := $js | resources.Fingerprint "sha512" -}} - + {{ $js := slice $lazysizes $flexsearch $instantPage $app | resources.Concat "main.js" -}} + {{ $jsProd := $js | resources.Fingerprint "sha512" -}} + {{ $indexProd := $index | resources.Minify | resources.Fingerprint "sha512" -}} + + {{ end -}} \ No newline at end of file diff --git a/layouts/partials/head/favicons.html b/layouts/partials/head/favicons.html index 5f87e69..3988156 100644 --- a/layouts/partials/head/favicons.html +++ b/layouts/partials/head/favicons.html @@ -1,5 +1,5 @@ - - - - \ No newline at end of file + + + + \ No newline at end of file diff --git a/layouts/partials/head/opengraph.html b/layouts/partials/head/opengraph.html new file mode 100644 index 0000000..8080840 --- /dev/null +++ b/layouts/partials/head/opengraph.html @@ -0,0 +1,93 @@ + + + +{{ if $.Scratch.Get "paginator" -}} + {{ $paginator := .Paginate (where .Site.RegularPages.ByDate.Reverse "Section" "blog" ) -}} + +{{ else -}} + +{{ end -}} + +{{ with $.Params.images -}} + {{ range first 6 . -}} + + {{ end -}} +{{ else -}} + {{ $images := $.Resources.ByType "image" -}} + {{ $featured := $images.GetMatch "*feature*" -}} + {{ if not $featured -}} + {{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }} + {{ end -}} + {{ with $featured -}} + + {{ else -}} + {{ with $.Site.Params.images -}} + + {{ end -}} + {{ end -}} +{{ end -}} + +{{ $iso8601 := "2006-01-02T15:04:05-07:00" -}} +{{ if .IsPage -}} + {{ if not .PublishDate.IsZero -}} + + {{ else if not .Date.IsZero -}} + + {{ end -}} + {{ if not .Lastmod.IsZero -}} + + {{ end -}} +{{ else -}} + {{ if not .Date.IsZero -}} + + {{ end -}} +{{ end -}} + +{{ with .Params.audio -}} + +{{ end -}} +{{ with .Params.locale -}} + +{{ end -}} +{{ with .Site.Params.title -}} + +{{ end -}} +{{ with .Params.videos -}} + {{ range . -}} + + {{ end -}} +{{ end -}} + +{{ $permalink := .Permalink -}} +{{ $siteSeries := .Site.Taxonomies.series -}} +{{ with .Params.series -}} + {{ range $name := . -}} + {{ $series := index $siteSeries $name -}} + {{ range $page := first 6 $series.Pages -}} + {{ if ne $page.Permalink $permalink -}} + + {{ end -}} + {{ end -}} + {{ end -}} +{{ end -}} + +{{ if .IsPage -}} + {{ range .Site.Authors -}} + {{ with .Social.facebook -}} + + {{ end -}} + {{ with .Site.Social.facebook -}} + + {{ end -}} + + {{ with .Params.tags -}} + {{ range first 6 . -}} + + {{ end -}} + {{ end -}} + {{ end -}} +{{ end -}} + +{{ with .Site.Social.facebook_admin -}} + +{{ end -}} \ No newline at end of file diff --git a/layouts/partials/head/resource-hints.html b/layouts/partials/head/resource-hints.html index bdda1d6..806ea80 100644 --- a/layouts/partials/head/resource-hints.html +++ b/layouts/partials/head/resource-hints.html @@ -1,6 +1,4 @@ - \ No newline at end of file + + + + \ No newline at end of file diff --git a/layouts/partials/head/script-header.html b/layouts/partials/head/script-header.html index 26bfd35..8baabaa 100644 --- a/layouts/partials/head/script-header.html +++ b/layouts/partials/head/script-header.html @@ -1,11 +1 @@ -{{ if isset .Site.Params "googleanalytics" -}} - -{{ end -}} \ No newline at end of file + \ No newline at end of file diff --git a/layouts/partials/head/seo.html b/layouts/partials/head/seo.html index 76bc26d..3b412d3 100644 --- a/layouts/partials/head/seo.html +++ b/layouts/partials/head/seo.html @@ -1,10 +1,12 @@ -{{ if and (eq .Kind "section" "taxonomy" "taxonomyTerm") (ne .Section "blog" ) -}} - +{{ if eq .Kind "404" -}} + {{ else -}} {{ with .Params.robots -}} - + {{ else -}} - + + + {{ end -}} {{ end -}} @@ -20,21 +22,29 @@ {{ end -}} -{{ with .Params.canonical -}} - -{{ else -}} +{{ if $.Scratch.Get "paginator" }} + + {{ if .Paginator.HasPrev -}} + + {{ end -}} + {{ if .Paginator.HasNext -}} + + {{ end -}} +{{ else -}} {{ end -}} -{{ template "_internal/twitter_cards.html" . -}} - - +{{ partial "head/twitter_cards.html" . }} + + -{{ template "_internal/opengraph.html" . -}} +{{ partial "head/opengraph.html" . }} + + {{ range .AlternativeOutputFormats -}} {{ end -}} -{{ block "head/structured-data" . }}{{ partial "head/structured-data.html" . }}{{ end }} +{{ partial "head/structured-data.html" . }} diff --git a/layouts/partials/head/structured-data.html b/layouts/partials/head/structured-data.html index 0098a5f..d54b24f 100644 --- a/layouts/partials/head/structured-data.html +++ b/layouts/partials/head/structured-data.html @@ -4,12 +4,13 @@ { "@context": "https://schema.org", "@type": "Organization", - "url": "{{ .Site.BaseURL }}", + "url": "{{ "/" | absURL }}", "name": "{{ .Site.Params.title }}", - "logo": "{{ .Site.BaseURL }}{{ .Site.Params.schemaLogo }}", + "logo": "{{ "/" | absURL }}{{ .Site.Params.schemaLogo }}", "sameAs": [ "{{ .Site.Params.schemaTwitter | safeURL }}", - "{{ .Site.Params.schemaLinkedIn | safeURL }}" + "{{ .Site.Params.schemaLinkedIn | safeURL }}", + "{{ .Site.Params.schemaGitHub | safeURL }}" ] } @@ -19,11 +20,12 @@ { "@context": "https://schema.org", "@type": "Person", - "url": "{{ .Site.BaseURL }}", + "url": "{{ "/" | absURL }}", "name": "{{ .Site.Params.title }}", "sameAs": [ "{{ .Site.Params.schemaTwitter | safeURL }}", - "{{ .Site.Params.schemaLinkedIn | safeURL }}" + "{{ .Site.Params.schemaLinkedIn | safeURL }}", + "{{ .Site.Params.schemaGitHub | safeURL }}" ] } @@ -33,10 +35,10 @@ { "@context": "https://schema.org", "@type": "WebSite", - "url": "{{ .Site.BaseURL }}", + "url": "{{ "/" | absURL }}", "potentialAction": { "@type": "SearchAction", - "target": "{{ .Site.BaseURL }}?q={search_term_string}", + "target": "{{ "/" | absURL }}?q={search_term_string}", "query-input": "required name=search_term_string" } } @@ -54,7 +56,7 @@ "@id": "{{ .Permalink }}" }, "headline": "{{ .Title }}", - "image": {{ apply .Params.images "absURL" "." }}, + "image": [{{ range $i, $e := .Params.images }}{{ if $i }}, {{ end }}{{ printf "%s%s" $.Permalink $e }}{{ end }}], "datePublished": "{{ .PublishDate.Format "2006-01-02T15:04:05CET" }}", "dateModified": "{{ .Lastmod.Format "2006-01-02T15:04:05CET" }}", "author": { @@ -67,7 +69,7 @@ {{ if eq .Site.Params.schemaType "Organization" -}} "logo": { "@type": "ImageObject", - "url": "{{ .Site.BaseURL }}{{ .Site.Params.schemaLogo }}" + "url": "{{ "/" | absURL }}{{ .Site.Params.schemaLogo }}" } {{ end -}} }, @@ -77,16 +79,20 @@ {{ end -}} {{ end -}} +{{ $dot := . -}} +{{ $dot.Scratch.Set "path" "" -}} +{{ $dot.Scratch.Set "breadcrumb" slice -}} + {{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" -}} {{ $.Scratch.Add "path" .Site.BaseURL -}} {{ $.Scratch.Add "breadcrumb" (slice (dict "url" .Site.BaseURL "name" "home" "position" 1 )) -}} -{{ range $index, $element := split $url "/" -}} - {{ $.Scratch.Add "path" $element -}} - {{ $.Scratch.Add "path" "/" -}} + {{ range $index, $element := split $url "/" -}} + {{ $dot.Scratch.Add "path" $element -}} + {{ $.Scratch.Add "path" "/" -}} {{ if ne $element "" -}} - {{ $.Scratch.Add "breadcrumb" (slice (dict "url" ($.Scratch.Get "path") "name" . "position" (add $index 2))) -}} - {{ end -}} + {{ $.Scratch.Add "breadcrumb" (slice (dict "url" ($.Scratch.Get "path") "name" . "position" (add $index 2))) -}} + {{ end -}} {{ end -}} + \ No newline at end of file diff --git a/layouts/partials/head/twitter_cards.html b/layouts/partials/head/twitter_cards.html new file mode 100644 index 0000000..d414116 --- /dev/null +++ b/layouts/partials/head/twitter_cards.html @@ -0,0 +1,33 @@ +{{ with $.Params.images -}} + + +{{ else -}} + {{ $images := $.Resources.ByType "image" -}} + {{ $featured := $images.GetMatch "*feature*" -}} + {{ if not $featured -}} + {{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" -}} + {{ end -}} + {{ with $featured -}} + + + {{ else -}} + {{ with $.Site.Params.images -}} + + + {{ else -}} + + {{ end -}} + {{ end -}} +{{ end -}} + + + +{{ with .Site.Social.twitter -}} + +{{ end -}} + +{{ range .Site.Authors -}} + {{ with .twitter -}} + + {{ end -}} +{{ end -}} \ No newline at end of file diff --git a/layouts/partials/header/header.html b/layouts/partials/header/header.html index 970c460..aa99135 100644 --- a/layouts/partials/header/header.html +++ b/layouts/partials/header/header.html @@ -1,9 +1,9 @@ - +