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

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