feat: add flexsearch

This commit is contained in:
Henk Verlinde 2020-11-04 08:26:58 +01:00
parent 90cea786c1
commit 97d8e2c0e2
130 changed files with 4162 additions and 1763 deletions

View File

@ -1,2 +1,3 @@
assets/js/index.js
assets/js/vendor
node_modules

View File

@ -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:

10
.markdownlint.json Normal file
View File

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

1
.markdownlintignore Normal file
View File

@ -0,0 +1 @@
node_modules

View File

@ -1,3 +1,3 @@
assets/scss/common/_syntax.scss
assets/scss/components/_syntax.scss
assets/scss/vendor
node_modules

View File

@ -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
- HUGO_RELEASE=0.75.1

View File

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

76
CODE_OF_CONDUCT.md Normal file
View File

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

View File

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

View File

@ -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/)

View File

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

View File

@ -2,6 +2,7 @@
title: "{{ replace .Name "-" " " | title }}"
description: ""
date: {{ .Date }}
lastmod: {{ .Date }}
draft: true
images: {{ .Site.Params.images }}
images: []
---

View File

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

View File

@ -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 href><span></span><span></span></a>';
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;
}
}());

11
assets/js/index.js Normal file
View File

@ -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 -}}
];

View File

@ -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";

View File

@ -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;
}

View File

@ -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;
}

View File

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

View File

@ -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 `<body>` 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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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
*/

View File

@ -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;
}

View File

@ -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;
}

17
babel.config.js Normal file
View File

@ -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'
]
}
}
]
]
};

View File

@ -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"

View File

@ -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 = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"feather feather-twitter\"><path d=\"M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z\"></path></svg>"
url = "https://twitter.com/getdoks"
weight = 10
# [[social]]
# name = "Twitter"
# pre = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"feather feather-twitter\"><path d=\"M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z\"></path></svg>"
# url = "https://twitter.com/gethyas"
# weight = 10
[[social]]
name = "GitHub"
pre = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"feather feather-github\"><path d=\"M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22\"></path></svg>"
url = "https://github.com/h-enk/doks"
post = "v0.1.0"
weight = 20

View File

@ -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 <a href=\"https://twitter.com/henkverlinde\">@HenkVerlinde</a>"
alert = false
alertText = "Like Doks? <a class=\"alert-link\" href=\"https://github.com/h-enk/doks/stargazers\">Star on GitHub</a>. Thanks!</a>"
hyasVersion = "v0.2.0"
docsRepo = "https://github.com/h-enk/doks"

View File

@ -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',
]),
],
}),

View File

@ -1,2 +0,0 @@
baseurl = "https://doks.netlify.app/"
canonifyURLs = false

View File

@ -1,2 +0,0 @@
baseurl = "https://doks-staging.netlify.app/"
canonifyURLs = false

View File

@ -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: []
---
<div class="row justify-content-center">
<div class="col-lg-5">
<h2 class="h4 mt-1">100/A+ scores</h2>
<p>Get perfect Google Lighthouse and <a href="https://observatory.mozilla.org/" target="_blank" rel="noreferrer noopener">Mozilla Observatory</a> scores by default.</p>
</div>
<div class="col-lg-5">
<h2 class="h4 mt-1">Algolia DocSearch</h2>
<p>The best search experience for docs, by <a href="https://docsearch.algolia.com/" target="_blank" rel="noreferrer noopener">Algolia</a>, for free.</p>
</div>
<div class="col-lg-5">
<h2 class="h4 mt-1">Dark/Light toggle</h2>
<p>Enable dark mode at night or in dark environments.</p>
</div>
</div>
<!--
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/h-enk/hyas "Deploy to Netlify")
-->

View File

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

View File

@ -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)

View File

@ -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: []
---

View File

@ -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"]
---

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -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!

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

10
content/contact/index.md Normal file
View File

@ -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: []
---
<p><script type="text/javascript" nonce="dXNlcj0iaGVsbG8iLGRvbWFpbj0iaGVua3ZlcmxpbmRlLmNvbSIsZG9jdW1lbnQud3JpdGUodXNlcisiQCIrZG9tYWluKTs=">user="hello",domain="henkverlinde.com",document.write(user+"@"+domain);</script><noscript>hello at henkverlinde.com</noscript></p>

View File

@ -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.

View File

@ -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)

View File

@ -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: []
---

View File

@ -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: []
---

View File

@ -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: [""]
---
{{</* img src="{{ .Name | urlize }}.jpg" alt="{{ replace .Name "-" " " | title }}" caption="{{ replace .Name "-" " " | title }}" class="wide" */>}}
```
## default.md
```md
---
title: "{{ replace .Name "-" " " | title }}"
description: ""
date: {{ .Date }}
lastmod: {{ .Date }}
draft: true
images: []
---
```

View File

@ -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/).

View File

@ -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/).

View File

@ -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/).

View File

@ -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/).

View File

@ -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. <a class=\"alert-link\" href=\"https://www.netlify.com/whitepaper/\">Get the free enterprise paper →</a>"
```
## 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" >}}).

View File

@ -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: []
---

View File

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

View File

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

View File

@ -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/)

View File

@ -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 <a href=\"https://googlechrome.github.io/lighthouse/viewer/?gist=8b7aec005ae7b9e128ad5c4e2f125fea\">Google Lighthouse</a> 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)

View File

@ -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 <a href=\"https://observatory.mozilla.org/analyze/hyas.netlify.app\">Mozilla Observatory</a> 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.

View File

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

View File

@ -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: []
---

View File

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

View File

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

View File

@ -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: []
---

View File

@ -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`

View File

@ -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: []
---

View File

@ -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
```

View File

@ -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 <command> [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 <command> --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 <command> [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
```

View File

@ -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. <a href=\"https://classic.yarnpkg.com/en/\">Yarn</a> 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.
<a class="btn btn-primary btn-sm px-3" href="https://app.netlify.com/start/deploy?repository=https://github.com/h-enk/hyas" role="button">Deploy to Netlify</a>
<!--
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/h-enk/hyas "Deploy to Netlify")
-->
## Example site
👉 [hyas.netlify.app](https://hyas.netlify.app/)

View File

@ -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 dont 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 visitors 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_

View File

@ -2,8 +2,8 @@
<div class="row justify-content-center">
<div class="col-md-12 col-lg-10 col-xl-8">
<article>
<h1 class="text-center">Page not found</h1>
<p class="text-center">The page you requested could not be found.</p>
<h1 class="text-center">Page not found :(</h1>
<p class="text-center">The page you are looking for doesn't exist or has been moved.</p>
</article>
</div>
</div>

View File

View File

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

View File

@ -1,6 +1,6 @@
<!doctype html>
<html lang="{{ .Site.LanguageCode | default "en" }}">
{{ 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 -}}
<body class="{{ .Scratch.Get "class" }}">
{{ block "header" . }}{{ partial "header/header.html" . }}{{ end }}
{{ partial "header/header.html" . }}
<div class="wrap container" role="document">
<div class="content">
{{ block "main" . }}{{ end }}
</div>
</div>
{{ if ne .Section "docs" }}
{{ block "footer" . }}{{ partial "footer/footer.html" . }}{{ end }}
{{ 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" . }}
</body>
</html>

10
layouts/_default/index.js Normal file
View File

@ -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 -}}
];

View File

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

View File

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

View File

@ -8,8 +8,8 @@
{{ range .Data.Pages -}}
<div class="card">
<div class="card-body">
<h2 class="h3"><a class="stretched-link" href="{{ .Permalink }}">{{ .Params.title }}</a></h2>
<p>{{ .Params.lead }}</p>
<h2 class="h3"><a class="stretched-link text-body" href="{{ .Permalink }}">{{ .Params.title }}</a></h2>
<p>{{ .Params.lead | safeHTML }}</p>
{{ partial "main/blog-meta.html" . -}}
</div>
</div>

View File

@ -6,7 +6,7 @@
<h1>{{ .Title }}</h1>
{{ partial "main/blog-meta.html" . }}
</div>
<p class="lead">{{ .Params.lead }}</p>
<p class="lead">{{ .Params.lead | safeHTML }}</p>
{{ .Content }}
</article>
</div>

View File

@ -8,9 +8,9 @@
{{ range .Data.Pages -}}
<div class="card">
<div class="card-body">
<h2 class="h3"><a class="stretched-link" href="{{ .Permalink }}">{{ .Params.title }}</a></h2>
<h2 class="h3"><a class="stretched-link text-body" href="{{ .Permalink }}">{{ .Params.title }}</a></h2>
{{ if eq .Section "blog" -}}
<p>{{ .Params.lead }}</p>
<p>{{ .Params.lead | safeHTML }}</p>
{{ partial "main/blog-meta.html" . -}}
{{ end -}}
</div>

View File

@ -12,6 +12,7 @@
<h1>{{ .Title }}</h1>
<p class="lead">{{ .Params.lead | safeHTML }}</p>
{{ partial "main/headline-hash.html" .Content }}
{{ partial "main/edit-page.html" . }}
{{ partial "main/docs-navigation.html" . }}
</main>
</div>

View File

@ -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'

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,3 @@
<div class="alert alert-primary fixed-bottom text-center" role="alert">
{{ .Site.Params.alertText | safeHTML }}
</div>

View File

@ -2,7 +2,12 @@
<div class="container">
<div class="row">
<div class="col-lg-16 text-center">
<p>{{ .Site.Params.footer | safeHTML }}</p>
<ul class="list-inline">
<!-- <li class="list-inline-item">{{ .Site.Params.footer | safeHTML }}</li> -->
<!-- <li class="list-inline-item"><a href="{{ "privacy-policy" | absURL }}">Privacy</a></li> -->
<li class="list-inline-item">This site is powered by <a href="https://gohugo.io/">Hugo</a> and the <a href="https://getdoks.org/">Doks</a> theme</li>
<!-- <li class="list-inline-item"><a href="https://gethyas.com/">This site is powered by Hyas</a></li> -->
</ul>
</div>
</div>
</div>

View File

@ -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" -}}
<script src="{{ $index.Permalink }}" defer></script>
<script src="{{ $js.Permalink }}" defer></script>
{{ 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" -}}
<script src="{{ $secureJS.Permalink }}" integrity="{{ $secureJS.Data.Integrity }}" crossorigin="anonymous" defer></script>
{{ $js := slice $lazysizes $flexsearch $instantPage $app | resources.Concat "main.js" -}}
{{ $jsProd := $js | resources.Fingerprint "sha512" -}}
{{ $indexProd := $index | resources.Minify | resources.Fingerprint "sha512" -}}
<script src="{{ $indexProd.Permalink }}" integrity="{{ $indexProd.Data.Integrity }}" crossorigin="anonymous" defer></script>
<script src="{{ $jsProd.Permalink }}" integrity="{{ $jsProd.Data.Integrity }}" crossorigin="anonymous" defer></script>
{{ end -}}

View File

@ -1,5 +1,5 @@
<meta name="theme-color" content="{{ $.Site.Params.themeColor }}">
<link rel="apple-touch-icon" sizes="180x180" href="{{ "apple-touch-icon.png" | absLangURL }}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ "favicon-32x32.png" | absLangURL }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ "favicon-16x16.png" | absLangURL }}">
<link rel="manifest" href="{{ "site.webmanifest" | absLangURL }}">
<link rel="apple-touch-icon" sizes="180x180" href="{{ "apple-touch-icon.png" | absURL }}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ "favicon-32x32.png" | absURL }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ "favicon-16x16.png" | absURL }}">
<link rel="manifest" href="{{ "site.webmanifest" | absURL }}">

View File

@ -0,0 +1,93 @@
<meta property="og:title" content="{{ .Title }}">
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}">
{{ if $.Scratch.Get "paginator" -}}
{{ $paginator := .Paginate (where .Site.RegularPages.ByDate.Reverse "Section" "blog" ) -}}
<meta property="og:url" content="{{ .Paginator.URL | absURL }}">
{{ else -}}
<meta property="og:url" content="{{ .Permalink }}">
{{ end -}}
{{ with $.Params.images -}}
{{ range first 6 . -}}
<meta property="og:image" content="{{ $.Permalink }}{{ . }}">
{{ end -}}
{{ else -}}
{{ $images := $.Resources.ByType "image" -}}
{{ $featured := $images.GetMatch "*feature*" -}}
{{ if not $featured -}}
{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}
{{ end -}}
{{ with $featured -}}
<meta property="og:image" content="{{ $featured.Permalink }}"/>
{{ else -}}
{{ with $.Site.Params.images -}}
<meta property="og:image" content="{{ index . 0 | absURL }}"/>
{{ end -}}
{{ end -}}
{{ end -}}
{{ $iso8601 := "2006-01-02T15:04:05-07:00" -}}
{{ if .IsPage -}}
{{ if not .PublishDate.IsZero -}}
<meta property="article:published_time" {{ .PublishDate.Format $iso8601 | printf "content=%q" | safeHTMLAttr }}>
{{ else if not .Date.IsZero -}}
<meta property="article:published_time" {{ .Date.Format $iso8601 | printf "content=%q" | safeHTMLAttr }}>
{{ end -}}
{{ if not .Lastmod.IsZero -}}
<meta property="article:modified_time" {{ .Lastmod.Format $iso8601 | printf "content=%q" | safeHTMLAttr }}>
{{ end -}}
{{ else -}}
{{ if not .Date.IsZero -}}
<meta property="og:updated_time" {{ .Lastmod.Format $iso8601 | printf "content=%q" | safeHTMLAttr }}>
{{ end -}}
{{ end -}}
{{ with .Params.audio -}}
<meta property="og:audio" content="{{ . }}">
{{ end -}}
{{ with .Params.locale -}}
<meta property="og:locale" content="{{ . }}">
{{ end -}}
{{ with .Site.Params.title -}}
<meta property="og:site_name" content="{{ . }}">
{{ end -}}
{{ with .Params.videos -}}
{{ range . -}}
<meta property="og:video" content="{{ . | absURL }}">
{{ 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 -}}
<meta property="og:see_also" content="{{ $page.Permalink }}">
{{ end -}}
{{ end -}}
{{ end -}}
{{ end -}}
{{ if .IsPage -}}
{{ range .Site.Authors -}}
{{ with .Social.facebook -}}
<meta property="article:author" content="https://www.facebook.com/{{ . }}">
{{ end -}}
{{ with .Site.Social.facebook -}}
<meta property="article:publisher" content="https://www.facebook.com/{{ . }}">
{{ end -}}
<meta property="article:section" content="{{ .Section }}">
{{ with .Params.tags -}}
{{ range first 6 . -}}
<meta property="article:tag" content="{{ . }}">
{{ end -}}
{{ end -}}
{{ end -}}
{{ end -}}
{{ with .Site.Social.facebook_admin -}}
<meta property="fb:admins" content="{{ . }}">
{{ end -}}

View File

@ -1,6 +1,4 @@
<!--
<link rel="preload" as="font" href="{{ .Site.BaseURL }}fonts/vendor/jost/Jost-400-Book.otf" type="font/otf" crossorigin>
<link rel="preload" as="font" href="{{ .Site.BaseURL }}fonts/vendor/jost/Jost-400-BookItalic.otf" type="font/otf" crossorigin>
<link rel="preload" as="font" href="{{ .Site.BaseURL }}fonts/vendor/jost/Jost-500-Medium.otf" type="font/otf" crossorigin>
<link rel="preload" as="font" href="{{ .Site.BaseURL }}fonts/vendor/jost/Jost-500-MediumItalic.otf" type="font/otf" crossorigin>
-->
<link rel="preload" as="font" href="{{ "fonts/vendor/jost/Jost-400-Book.otf" | absURL }}" type="font/otf" crossorigin>
<link rel="preload" as="font" href="{{ "fonts/vendor/jost/Jost-400-BookItalic.otf" | absURL }}" type="font/otf" crossorigin>
<link rel="preload" as="font" href="{{ "fonts/vendor/jost/Jost-500-Medium.otf" | absURL }}" type="font/otf" crossorigin>
<link rel="preload" as="font" href="{{ "fonts/vendor/jost/Jost-500-MediumItalic.otf" | absURL }}" type="font/otf" crossorigin>

View File

@ -1,11 +1 @@
{{ if isset .Site.Params "googleanalytics" -}}
<script>
(function(e,t,n,i,s,a,c){e[n]=e[n]||function(){(e[n].q=e[n].q||[]).push(arguments)}
;a=t.createElement(i);c=t.getElementsByTagName(i)[0];a.async=true;a.src=s
;c.parentNode.insertBefore(a,c)
})(window,document,"galite","script","{{ .Site.BaseURL }}js/vendor/ga-lite/ga-lite.min.js");
galite('create', '{{ $.Site.Params.googleAnalytics }}', 'auto');
galite('send', 'pageview');
</script>
{{ end -}}
<script async defer data-domain="gethyas.com" src="https://stats.gethyas.com/js/index.js"></script>

View File

@ -1,10 +1,12 @@
{{ if and (eq .Kind "section" "taxonomy" "taxonomyTerm") (ne .Section "blog" ) -}}
<meta name="robots" content="noindex, noarchive">
{{ if eq .Kind "404" -}}
<meta name="robots" content="noindex, follow">
{{ else -}}
{{ with .Params.robots -}}
<meta name="robots" content="{{ . }}">
{{ else -}}
<meta name="robots" content="index, follow">
<meta name="googlebot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1">
<meta name="bingbot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1">
{{ end -}}
{{ end -}}
@ -20,21 +22,29 @@
<meta name="description" content="{{ .Site.Params.description }}">
{{ end -}}
{{ with .Params.canonical -}}
<link rel="canonical" href="{{ . }}">
{{ if $.Scratch.Get "paginator" }}
<link rel="canonical" href="{{ .Paginator.URL | absURL }}">
{{ if .Paginator.HasPrev -}}
<link rel="prev" href="{{ .Paginator.Prev.URL | absURL }}">
{{ end -}}
{{ if .Paginator.HasNext -}}
<link rel="next" href="{{ .Paginator.Next.URL | absURL }}">
{{ end -}}
{{ else -}}
<link rel="canonical" href="{{ .Permalink }}">
{{ end -}}
{{ template "_internal/twitter_cards.html" . -}}
<meta name="twitter:site" content="{{ .Site.Params.twitterSite }}">
<meta name="twitter:creator" content="{{ .Site.Params.twitterCreator }}">
{{ partial "head/twitter_cards.html" . }}
<meta name="twitter:site" content="@{{ .Site.Params.twitterSite }}">
<meta name="twitter:creator" content="@{{ .Site.Params.twitterCreator }}">
{{ template "_internal/opengraph.html" . -}}
{{ partial "head/opengraph.html" . }}
<meta property="article:publisher" content="https://www.facebook.com/{{ .Site.Params.facebookPublisher }}">
<meta property="article:author" content="https://www.facebook.com/{{ .Site.Params.facebookAuthor }}">
<meta property="og:locale" content="{{ .Site.Params.ogLocale }}">
{{ range .AlternativeOutputFormats -}}
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
{{ end -}}
{{ block "head/structured-data" . }}{{ partial "head/structured-data.html" . }}{{ end }}
{{ partial "head/structured-data.html" . }}

View File

@ -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 }}"
]
}
</script>
@ -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 }}"
]
}
</script>
@ -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,12 +79,16 @@
{{ 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 -}}
{{ $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))) -}}
@ -96,10 +102,8 @@
"itemListElement": [{{ range $.Scratch.Get "breadcrumb" }}{{ if ne .position 1 }},{{ end }}{
"@type": "ListItem",
"position": {{ .position }},
"item": {
"@id": "{{ .url }}",
"name": "{{ .name }}"
}
"name": "{{ .name | humanize | title }}",
"item": "{{ .url }}"
}{{ end }}]
}
</script>

View File

@ -0,0 +1,33 @@
{{ with $.Params.images -}}
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="{{ $.Permalink }}{{ index . 0 }}">
{{ else -}}
{{ $images := $.Resources.ByType "image" -}}
{{ $featured := $images.GetMatch "*feature*" -}}
{{ if not $featured -}}
{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" -}}
{{ end -}}
{{ with $featured -}}
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="{{ $featured.Permalink }}">
{{ else -}}
{{ with $.Site.Params.images -}}
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="{{ index . 0 | absURL }}">
{{ else -}}
<meta name="twitter:card" content="summary">
{{ end -}}
{{ end -}}
{{ end -}}
<meta name="twitter:title" content="{{ .Title }}">
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
{{ with .Site.Social.twitter -}}
<meta name="twitter:site" content="@{{ . }}">
{{ end -}}
{{ range .Site.Authors -}}
{{ with .twitter -}}
<meta name="twitter:creator" content="@{{ . }}">
{{ end -}}
{{ end -}}

View File

@ -1,9 +1,9 @@
<!-- <div class="header-bar fixed-top"></div> -->
<div class="header-bar fixed-top"></div>
<header class="navbar fixed-top navbar-expand-md navbar-light">
<div class="container">
<input class="menu-btn order-0" type="checkbox" id="menu-btn">
<label class="menu-icon d-md-none" for="menu-btn"><span class="navicon"></span></label>
<a class="navbar-brand order-1 order-md-0 mr-auto" href="{{ .Site.BaseURL }}">{{ .Site.Params.Title }}</a>
<a class="navbar-brand order-1 order-md-0 mr-auto text-primary" href="{{ "/" | absURL }}">{{ .Site.Params.Title }}</a>
<button id="mode" class="btn btn-link order-2 order-md-4" type="button" aria-label="Toggle mode">
<span class="toggle-dark"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-moon"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg></span>
<span class="toggle-light"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-sun"><circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line></svg></span>
@ -11,7 +11,7 @@
<ul class="navbar-nav social-nav order-3 order-md-5">
{{ range .Site.Menus.social -}}
<li class="nav-item">
<a class="nav-link" href="{{ .URL | absLangURL }}" target="_blank" rel="noreferrer noopener">{{ .Pre | safeHTML }}<span class="ml-2 sr-only">{{ .Name | safeHTML }}</span></a>
<a class="nav-link" href="{{ .URL | absURL }}">{{ .Pre | safeHTML }}<span class="ml-2 sr-only">{{ .Name | safeHTML }}</span></a>
</li>
{{ end -}}
</ul>
@ -25,13 +25,19 @@
{{- $active = or $active (and (eq .Name "Guides") (eq $current.Section "guides")) -}}
{{- $active = or $active (and (eq .Name "Blog") (eq $current.Section "blog" "authors")) -}}
<li class="nav-item{{ if $active }} active{{ end }}">
<a class="nav-link" href="{{ .URL | absLangURL }}">{{ .Name }}</a>
<a class="nav-link" href="{{ .URL | absURL }}">{{ .Name }}</a>
</li>
{{ end -}}
<!--
<li class="nav-item">
<a class="nav-link" href="https://community.gethyas.com/">Community</a>
</li>
-->
</ul>
<div class="break order-6 d-md-none"></div>
<form class="navbar-form flex-grow-1 order-7 order-md-3">
<input class="form-control is-search" type="search" placeholder="Search {{ .Site.Params.Title }} docs..." aria-label="Search {{ .Site.Params.Title }} docs...">
<input id="userinput" class="form-control is-search" type="search" placeholder="Search docs..." aria-label="Search docs..." autocomplete="off">
<div id="suggestions" class="shadow bg-white rounded"></div>
</form>
</div>
</div>

Some files were not shown because too many files have changed in this diff Show More