docs: update content

This commit is contained in:
Henk Verlinde 2020-12-03 16:07:04 +01:00
parent 0377b0de75
commit 63ca41e107
26 changed files with 345 additions and 151 deletions

View File

@ -1,7 +1,7 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node # Test and build your Hyas project
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions # For more information see: https://henkverlinde.com/continuous-integration-workflow-for-your-hyas-project/
name: CI name: Hyas CI
on: on:
push: push:

3
.gitignore vendored
View File

@ -1,5 +1,4 @@
functions functions
node_modules node_modules
public public
resources resources
yarn-error.log

View File

@ -32,32 +32,34 @@ Nine reasons why you should use Doks:
Make sure all dependencies have been installed: Make sure all dependencies have been installed:
- [Hugo](https://gohugo.io/) >= 0.75.0/extended - [Hugo](https://gohugo.io/getting-started/installing/) >= 0.75.0/extended (needed for SCSS processing support)
- [Node.js](https://nodejs.org/) >= 14.15.0 (needed to install npm packages and run commands) - [Node.js](https://nodejs.org/) >= 14.15.0 (needed to install npm packages and run commands)
## Get started ## Get started
Create a new Doks project: Have your Doks site in three steps:
### 1. Create a new Doks project:
```bash ```bash
git clone https://github.com/h-enk/doks.git my-doks-site git clone https://github.com/h-enk/doks.git my-doks-site
``` ```
Install npm packages: ### 2. Install npm packages:
```bash ```bash
npm install npm install
``` ```
Start local development server: ### 3. Start local development server:
```bash ```bash
npm run start npm run start
``` ```
### Other commands ## Other commands
Doks comes with [commands for most used tasks](https://getdoks.org/docs/prologue/commands/). Doks comes with [commands](https://getdoks.org/docs/prologue/commands/) for common tasks.
## Quick start ## Quick start
@ -67,7 +69,7 @@ Get your Doks site in 1 min.
## Example site ## Example site
👉 [doks.netlify.app](https://doks.netlify.app/) - [doks.netlify.app](https://doks.netlify.app/)
## Documentation ## Documentation

View File

@ -148,3 +148,22 @@ Source:
} }
}()); }());
/* eslint-disable */
var clipboard = new ClipboardJS('.btn-clipboard');
clipboard.on('success', function(e) {
/*
console.info('Action:', e.action);
console.info('Text:', e.text);
console.info('Trigger:', e.trigger);
*/
e.clearSelection();
});
clipboard.on('error', function(e) {
console.error('Action:', e.action);
console.error('Trigger:', e.trigger);
});
/* eslint-enable */

View File

@ -279,3 +279,7 @@ body.dark .alert-primary {
background: $link-color-dark; background: $link-color-dark;
color: $body-bg-dark; color: $body-bg-dark;
} }
body.dark .figure-caption {
color: $body-color-dark;
}

View File

@ -2,7 +2,9 @@
.blog .content, .blog .content,
.page .content, .page .content,
.error404 .content, .error404 .content,
.docs.list .content { .docs.list .content,
.tutorial.list .content,
.showcase.list .content {
padding-top: 1rem; padding-top: 1rem;
padding-bottom: 3rem; padding-bottom: 3rem;
} }
@ -112,14 +114,15 @@ body {
@supports ((position: -webkit-sticky) or (position: sticky)) { @supports ((position: -webkit-sticky) or (position: sticky)) {
.docs-links { .docs-links {
max-height: calc(100vh - 4rem); max-height: calc(100vh - 4rem);
overflow-y: auto; overflow-y: scroll;
} }
} }
} }
@include media-breakpoint-up(lg) { @include media-breakpoint-up(lg) {
.docs-links { .docs-links {
display: block !important; display: block;
width: auto;
margin-right: -1.5rem; margin-right: -1.5rem;
padding-bottom: 4rem; padding-bottom: 4rem;
} }

View File

@ -91,3 +91,20 @@ a.docs-link {
text-decoration: none; text-decoration: none;
color: $link-color; color: $link-color;
} }
.docs-links h3.sidebar-link,
.page-links h3.sidebar-link {
text-transform: none;
font-size: $font-size-md;
font-weight: normal;
}
.docs-links h3.sidebar-link a,
.page-links h3.sidebar-link a {
color: $body-color;
}
.docs-links h3.sidebar-link a:hover,
.page-links h3.sidebar-link a:hover {
text-decoration: underline;
}

View File

@ -88,3 +88,6 @@ rel = "sitemap"
[[module.mounts]] [[module.mounts]]
source = "node_modules/flexsearch" source = "node_modules/flexsearch"
target = "assets/js/vendor/flexsearch" target = "assets/js/vendor/flexsearch"
[[module.mounts]]
source = "node_modules/clipboard"
target = "assets/js/vendor/clipboard"

View File

@ -6,7 +6,7 @@
[[docs]] [[docs]]
name = "Help" name = "Help"
weight = 50 weight = 60
identifier = "help" identifier = "help"
url = "/docs/help/" url = "/docs/help/"

View File

@ -1,16 +1,20 @@
# Meta Data for SEO
## Homepage
title = "Doks" title = "Doks"
titleSeparator = "-" titleSeparator = "-"
titleAddition = "Modern Documentation Theme" titleAddition = "Modern Documentation Theme"
description = "Doks is a Hugo theme helping you build modern documentation websites that are secure, fast, and SEO-ready — by default." description = "Doks is a Hugo theme helping you build modern documentation websites that are secure, fast, and SEO-ready — by default."
## Open Graph + Twitter Cards
images = ["doks.png"] images = ["doks.png"]
twitterSite = "henkverlinde" twitterSite = "henkverlinde"
twitterCreator = "henkverlinde" twitterCreator = "henkverlinde"
facebookAuthor = "verlinde.henk" facebookAuthor = "verlinde.henk"
facebookPublisher = "verlinde.henk" facebookPublisher = "verlinde.henk"
ogLocale = "en_US" ogLocale = "en_US"
## JSON-LD
schemaType = "Organization" schemaType = "Organization"
schemaLogo = "logo-doks.png" schemaLogo = "logo-doks.png"
schemaTwitter = "https://twitter.com/henkverlinde" schemaTwitter = "https://twitter.com/henkverlinde"
@ -18,19 +22,26 @@ schemaLinkedIn = "https://www.linkedin.com/in/henkverlinde/"
schemaGitHub = "https://github.com/h-enk" schemaGitHub = "https://github.com/h-enk"
schemaSection = "blog" schemaSection = "blog"
## Sitelinks Search Box
siteLinksSearchBox = false siteLinksSearchBox = false
## Chrome Browser
themeColor = "#fff" themeColor = "#fff"
# Images
quality = 85 quality = 85
bgColor = "#fff" bgColor = "#fff"
landscapePhotoWidths = [900, 800, 700, 600, 500] landscapePhotoWidths = [900, 800, 700, 600, 500]
portraitPhotoWidths = [800, 700, 600, 500] portraitPhotoWidths = [800, 700, 600, 500]
lqipWidth = "20x" lqipWidth = "20x"
# Footer
footer = "Powered by <a href=\"https://www.netlify.com/\">Netlify</a>, <a href=\"https://gohugo.io/\">Hugo</a>, and <a href=\"https://getdoks.org/\">Doks</a>" footer = "Powered by <a href=\"https://www.netlify.com/\">Netlify</a>, <a href=\"https://gohugo.io/\">Hugo</a>, and <a href=\"https://getdoks.org/\">Doks</a>"
# Alert
alert = false alert = false
alertText = "Like Doks? <a class=\"alert-link\" href=\"https://github.com/h-enk/doks/stargazers\">Star on GitHub</a>. Thanks!</a>" alertText = "Like Doks? <a class=\"alert-link\" href=\"https://github.com/h-enk/doks/stargazers\">Star on GitHub</a>. Thanks!</a>"
# Edit Page
docsRepo = "https://github.com/h-enk/doks" docsRepo = "https://github.com/h-enk/doks"
editPage = false

View File

@ -7,3 +7,5 @@ lastmod: 2020-10-06T08:47:36+00:00
draft: false draft: false
images: [] images: []
--- ---
Like Doks? [Star on GitHub](https://github.com/h-enk/doks/stargazers)! ⭐️🙏

View File

@ -7,6 +7,6 @@ draft: false
images: [] images: []
--- ---
Creator of [Hyas](https://github.com/h-enk/hyas). Creator of Hyas.
[@HenkVerlinde](https://twitter.com/henkverlinde) [@HenkVerlinde](https://twitter.com/henkverlinde)

View File

@ -9,7 +9,7 @@ images: []
menu: menu:
docs: docs:
parent: "help" parent: "help"
weight: 540 weight: 630
toc: true toc: true
--- ---
@ -28,6 +28,11 @@ Please keep it in place.
- open: `Enter` - open: `Enter`
- close: `Esc` - close: `Esc`
## Other documentation?
- [Netlify](https://docs.netlify.com/)
- [Hugo](https://gohugo.io/documentation/)
## Can I get support? ## Can I get support?
Create a topic: Create a topic:

View File

@ -0,0 +1,24 @@
---
title: "How to Update"
description: "Regularly update the installed npm packages to keep your Doks website stable, usable, and secure."
lead: "Regularly update the installed npm packages to keep your Doks website stable, usable, and secure."
date: 2020-11-12T13:26:54+01:00
lastmod: 2020-11-12T13:26:54+01:00
draft: false
images: []
menu:
docs:
parent: "help"
weight: 610
toc: true
---
{{< alert icon="💡" text="Learn more about <a href=\"https://docs.npmjs.com/about-semantic-versioning\">semantic versioning</a> and <a href=\"https://docs.npmjs.com/cli/v6/using-npm/semver#advanced-range-syntax\">advanced range syntax</a>." >}}
## Update npm packages
Bump the versions in the `devDependencies` section of `./package.json` to your liking, and run:
```bash
npm update
```

View File

@ -0,0 +1,30 @@
---
title: "Troubleshooting"
description: "Solutions to common problems."
lead: "Solutions to common problems."
date: 2020-11-12T15:22:20+01:00
lastmod: 2020-11-12T15:22:20+01:00
draft: false
images: []
menu:
docs:
parent: "help"
weight: 620
toc: true
---
## Problems updating npm packages
Delete the `./node_modules` folder, and run again:
```bash
npm install
```
## Problems with cache
Delete the temporary directories:
```bash
npm run clean
```

View File

@ -1,7 +1,7 @@
--- ---
title: "Commands" title: "Commands"
description: "Doks comes with commands for most used tasks." description: "Doks comes with commands for common tasks."
lead: "Doks comes with commands for most used tasks." lead: "Doks comes with commands for common tasks."
date: 2020-10-13T15:21:01+02:00 date: 2020-10-13T15:21:01+02:00
lastmod: 2020-10-13T15:21:01+02:00 lastmod: 2020-10-13T15:21:01+02:00
draft: false draft: false
@ -9,7 +9,7 @@ images: []
menu: menu:
docs: docs:
parent: "prologue" parent: "prologue"
weight: 030 weight: 130
toc: true toc: true
--- ---
@ -19,6 +19,8 @@ toc: true
Start local development server: Start local development server:
{{< btn-copy text="npm run start" >}}
```bash ```bash
npm run start npm run start
``` ```
@ -27,6 +29,8 @@ npm run start
Check scripts, styles, and markdown for errors: Check scripts, styles, and markdown for errors:
{{< btn-copy text="npm run lint" >}}
```bash ```bash
npm run lint npm run lint
``` ```
@ -35,6 +39,8 @@ npm run lint
Check scripts for errors: Check scripts for errors:
{{< btn-copy text="npm run lint:scripts" >}}
```bash ```bash
npm run lint:scripts [-- --fix] npm run lint:scripts [-- --fix]
``` ```
@ -43,6 +49,8 @@ npm run lint:scripts [-- --fix]
Check styles for errors: Check styles for errors:
{{< btn-copy text="npm run lint:styles" >}}
```bash ```bash
npm run lint:styles [-- --fix] npm run lint:styles [-- --fix]
``` ```
@ -51,6 +59,8 @@ npm run lint:styles [-- --fix]
Check markdown for errors: Check markdown for errors:
{{< btn-copy text="npm run lint:markdown" >}}
```bash ```bash
npm run lint:markdown [-- --fix] npm run lint:markdown [-- --fix]
``` ```
@ -59,6 +69,8 @@ npm run lint:markdown [-- --fix]
Delete temporary directories: Delete temporary directories:
{{< btn-copy text="npm run clean" >}}
```bash ```bash
npm run clean npm run clean
``` ```
@ -67,6 +79,8 @@ npm run clean
Build production website: Build production website:
{{< btn-copy text="npm run build" >}}
```bash ```bash
npm run build npm run build
``` ```
@ -75,6 +89,8 @@ npm run build
Build Lambda functions: Build Lambda functions:
{{< btn-copy text="npm run build:functions" >}}
```bash ```bash
npm run build:functions npm run build:functions
``` ```
@ -83,6 +99,8 @@ npm run build:functions
Build production website including draft and future content: Build production website including draft and future content:
{{< btn-copy text="npm run build:preview" >}}
```bash ```bash
npm run build:preview npm run build:preview
``` ```

View File

@ -9,80 +9,50 @@ images: []
menu: menu:
docs: docs:
parent: "prologue" parent: "prologue"
weight: 010 weight: 100
toc: true toc: true
--- ---
## Why Doks?
Nine reasons why you should use Doks:
1. __Security aware__. Get A+ scores on [Mozilla Observatory](https://observatory.mozilla.org/analyze/doks.netlify.app) out of the box. Easily change the default Security Headers to suit your needs.
2. __Fast by default__. Get 100 scores on [Google Lighthouse](https://googlechrome.github.io/lighthouse/viewer/?gist=7731347bb8ce999eff7428a8e763b637) by default. Doks 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.
7. __Full text search__. Search your Doks site with FlexSearch. Easily customize index settings and search options to your liking.
8. __Page layouts__. Build pages with a landing page, blog, or documentation layout. Add custom sections and components to suit your needs.
9. __Dark mode__. Switch to a low-light UI with the click of a button. Change colors with variables to match your branding.
## Requirements
Make sure all dependencies have been installed:
- [Hugo](https://gohugo.io/) >= 0.75.0/extended
- [Node.js](https://nodejs.org/) >= 14.15.0 (needed to install npm packages and run commands)
## Get started ## Get started
Create a new Doks project: There are two main ways to get started with Doks:
```bash ### Tutorial
git clone https://github.com/h-enk/doks.git my-doks-site
```
Install npm packages: {{< alert icon="👉" text="The Tutorial is intended for novice to intermediate users." >}}
```bash Step-by-step instructions on how to start a new Doks project. [Tutorial →](https://getdoks.org/tutorial/introduction/)
npm install
```
Start local development server: ### Quick Start
```bash {{< alert icon="👉" text="The Quick Start is intended for intermediate to advanced users." >}}
npm run start
```
### Other commands One page summary of how to start a new Doks project. [Quick Start →]({{< ref "quick-start" >}})
Doks comes with [commands for most used tasks]({{< ref "commands" >}}). ## Go further
## Quick start Recipes, Reference Guides, Extensions, and Showcase.
Get your Doks site in 1 min. ### Recipes
<a class="btn btn-primary btn-sm px-3" href="https://app.netlify.com/start/deploy?repository=https://github.com/h-enk/doks" role="button">Deploy to Netlify</a> Get instructions on how to accomplish common tasks with Doks. [Recipes →](https://getdoks.org/docs/recipes/project-configuration/)
## Example site ### Reference Guides
👉 [doks.netlify.app](https://doks.netlify.app/) Learn how to customize Doks to fully make it your own. [Reference Guides →](https://getdoks.org/docs/reference-guides/security/)
## Documentation ### Extensions
- [Netlify](https://docs.netlify.com/) Get instructions on how to add even more to Doks. [Extensions →](https://getdoks.org/docs/extensions/add-google-fonts/)
- [Hugo](https://gohugo.io/documentation/)
- [Doks](https://getdoks.org/)
## Communities ### Showcase
- [Netlify Community](https://community.netlify.com/) See what others have build with Doks. [Showcase →](https://getdoks.org/showcase/causal-data-science-meeting/)
- [Hugo Forums](https://discourse.gohugo.io/)
## Contributing
Find out how to contribute to Doks. [Contributing →](https://getdoks.org/docs/contributing/how-to-contribute/)
## Help
Get help on Doks. [Help →]({{< ref "how-to-update" >}})

View File

@ -0,0 +1,65 @@
---
title: "Quick Start"
description: "One page summary of how to start a new Doks project."
lead: "One page summary of how to start a new Doks project."
date: 2020-11-16T13:59:39+01:00
lastmod: 2020-11-16T13:59:39+01:00
draft: false
images: []
menu:
docs:
parent: "prologue"
weight: 110
toc: true
---
## Requirements
{{< alert icon="👉" text="Node.js is needed to install npm packages and run commands." >}}
Make sure all dependencies have been installed:
- [Hugo](https://gohugo.io/getting-started/installing/) >= 0.75.0/extended
- [Node.js](https://nodejs.org/) >= 14.15.0
## Start a new Doks project
Create a new site, change directories, install npm packages, and start development server.
### Create a new site
{{< btn-copy text="git clone https://github.com/h-enk/doks.git my-doks-site" >}}
```bash
git clone https://github.com/h-enk/doks.git my-doks-site
```
### Change directories
{{< btn-copy text="cd my-doks-site" >}}
```bash
cd my-doks-site
```
### Install npm packages
{{< btn-copy text="npm install" >}}
```bash
npm install
```
### Start development server
{{< btn-copy text="npm run start" >}}
```bash
npm run start
```
Doks will start the Hugo development webserver accessible by default at `http://localhost:1313`. Saved changes will live reload in the browser.
## Other commands
Doks comes with commands for common tasks. [Commands →]({{< ref "commands" >}})

View File

@ -5,14 +5,22 @@
{{ partial "sidebar/docs-menu.html" . }} {{ partial "sidebar/docs-menu.html" . }}
</nav> </nav>
</div> </div>
{{ if ne .Params.toc false -}}
<nav class="docs-toc d-none d-xl-block col-xl-3" aria-label="Secondary navigation"> <nav class="docs-toc d-none d-xl-block col-xl-3" aria-label="Secondary navigation">
{{ partial "sidebar/docs-toc.html" . }} {{ partial "sidebar/docs-toc.html" . }}
</nav> </nav>
{{ end -}}
{{ if .Params.toc -}}
<main class="docs-content col-lg-11 col-xl-9"> <main class="docs-content col-lg-11 col-xl-9">
{{ else -}}
<main class="docs-content col-lg-11 col-xl-9 mx-xl-auto">
{{ end -}}
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
<p class="lead">{{ .Params.lead | safeHTML }}</p> <p class="lead">{{ .Params.lead | safeHTML }}</p>
{{ partial "main/headline-hash.html" .Content }} {{ partial "main/headline-hash.html" .Content }}
{{ partial "main/edit-page.html" . }} {{ if .Site.Params.editPage -}}
{{ partial "main/edit-page.html" . }}
{{ end -}}
{{ partial "main/docs-navigation.html" . }} {{ partial "main/docs-navigation.html" . }}
</main> </main>
</div> </div>

View File

@ -14,41 +14,8 @@
{{ end }} {{ end }}
{{ define "sidebar-prefooter" }} {{ define "sidebar-prefooter" }}
<!--
<div class="d-flex justify-content-start">
<div class="bg-dots"></div>
</div>
<section class="section section-sm"> <section class="section section-sm">
<div class="container"> <div class="container">
<div class="row justify-content-center text-center mt-n3">
<div class="col-lg-5">
<h2 class="h4">Security aware</h2>
<p>Get A+ scores on <a href="https://observatory.mozilla.org/analyze/doks.netlify.app">Mozilla Observatory</a> out of the box. Easily change the default Security Headers to suit your needs.</p>
</div>
<div class="col-lg-5">
<h2 class="h4">Fast by default</h2>
<p>Get 100 scores on <a href="https://googlechrome.github.io/lighthouse/viewer/?gist=7731347bb8ce999eff7428a8e763b637">Google Lighthouse</a> by default. Doks removes unused css, prefetches links, and lazy loads images.</p>
</div>
<div class="col-lg-5">
<h2 class="h4">SEO-ready</h2>
<p>Use sensible defaults for structured data, open graph, and Twitter cards. Or easily change the SEO settings to your liking.</p>
</div>
</div>
<div class="row justify-content-center text-center mt-lg-3">
<div class="col-lg-5">
<h2 class="h4">Development tools</h2>
<p>Code with confidence. Check styles, scripts, and markdown for errors and fix automatically or manually.</p>
</div>
<div class="col-lg-5">
<h2 class="h4">Bootstrap framework</h2>
<p>Build robust, flexible, and intuitive websites with Bootstrap. Or use any other front-end framework if you prefer.</p>
</div>
<div class="col-lg-5">
<h2 class="h4">Netlify-ready</h2>
<p>Deploy to Netlify with sensible defaults. Easily use Netlify Functions, Netlify Redirects, and Netlify Headers.</p>
</div>
</div>
<div class="row justify-content-center text-center mt-lg-3"> <div class="row justify-content-center text-center mt-lg-3">
<div class="col-lg-5"> <div class="col-lg-5">
<h2 class="h4">Full text search</h2> <h2 class="h4">Full text search</h2>
@ -65,46 +32,14 @@
</div> </div>
</div> </div>
</section> </section>
-->
{{ end }} {{ end }}
{{ define "sidebar-footer" }} {{ define "sidebar-footer" }}
<!-- <section class="section container-fluid mt-n3">
<section class="section container-fluid mt-n5">
<div class="row justify-content-center text-center"> <div class="row justify-content-center text-center">
<div class="col-lg-9"> <div class="col-lg-9">
<h2 class="mt-0">Quick Start</h2>
<p>Get your Doks site in 1 min.</p>
<a class="btn btn-primary px-3" href="https://app.netlify.com/start/deploy?repository=https://github.com/h-enk/doks" role="button">Deploy to Netlify</a>
{{- .Content -}} {{- .Content -}}
</div> </div>
</div> </div>
</section> </section>
<div class="d-flex justify-content-end">
<div class="bg-dots bg-dots-md"></div>
</div>
<section class="section section-sm mt-n3">
<div class="container">
<div class="row justify-content-center">
<div class="col-md-12 col-lg-10 col-xl-8">
<h2 class="mt-3 text-center">Doks Blog</h2>
<div class="card-list">
{{ range first 3 (where .Site.RegularPages.ByDate.Reverse "Section" "blog") -}}
<div class="card">
<div class="card-body">
<h3><a class="stretched-link text-body" href="{{ .Permalink }}">{{ .Params.title }}</a></h3>
<p>{{ .Params.lead | safeHTML }}</p>
{{ partial "main/blog-meta.html" . -}}
</div>
</div>
{{ end -}}
</div>
</div>
</div>
</div>
</section>
-->
{{ end }} {{ end }}

View File

@ -2,15 +2,16 @@
{{ $index := $indexTemplate | resources.ExecuteAsTemplate "index.js" . -}} {{ $index := $indexTemplate | resources.ExecuteAsTemplate "index.js" . -}}
{{ $lazysizes := resources.Get "js/vendor/lazysizes/lazysizes.min.js" -}} {{ $lazysizes := resources.Get "js/vendor/lazysizes/lazysizes.min.js" -}}
{{ $flexsearch := resources.Get "js/vendor/flexsearch/dist/flexsearch.min.js" -}} {{ $flexsearch := resources.Get "js/vendor/flexsearch/dist/flexsearch.min.js" -}}
{{ $clipboard := resources.Get "js/vendor/clipboard/dist/clipboard.min.js" -}}
{{ if eq (hugo.Environment) "development" -}} {{ if eq (hugo.Environment) "development" -}}
{{ $app := resources.Get "js/app.js" -}} {{ $app := resources.Get "js/app.js" -}}
{{ $js := slice $lazysizes $flexsearch $app | resources.Concat "main.js" -}} {{ $js := slice $lazysizes $clipboard $flexsearch $app | resources.Concat "main.js" -}}
<script src="{{ $index.Permalink }}" defer></script> <script src="{{ $index.Permalink }}" defer></script>
<script src="{{ $js.Permalink }}" defer></script> <script src="{{ $js.Permalink }}" defer></script>
{{ else -}} {{ else -}}
{{ $instantPage := resources.Get "js/vendor/instant.page/instantpage.js" | minify -}} {{ $instantPage := resources.Get "js/vendor/instant.page/instantpage.js" | minify -}}
{{ $app := resources.Get "js/app.js" | minify -}} {{ $app := resources.Get "js/app.js" | minify -}}
{{ $js := slice $lazysizes $flexsearch $instantPage $app | resources.Concat "main.js" -}} {{ $js := slice $lazysizes $clipboard $flexsearch $instantPage $app | resources.Concat "main.js" -}}
{{ $jsProd := $js | resources.Fingerprint "sha512" -}} {{ $jsProd := $js | resources.Fingerprint "sha512" -}}
{{ $indexProd := $index | resources.Minify | resources.Fingerprint "sha512" -}} {{ $indexProd := $index | resources.Minify | resources.Fingerprint "sha512" -}}
<script src="{{ $indexProd.Permalink }}" integrity="{{ $indexProd.Data.Integrity }}" crossorigin="anonymous" defer></script> <script src="{{ $indexProd.Permalink }}" integrity="{{ $indexProd.Data.Integrity }}" crossorigin="anonymous" defer></script>

View File

@ -7,4 +7,4 @@
{{ block "head/seo" . }}{{ partial "head/seo.html" . }}{{ end }} {{ block "head/seo" . }}{{ partial "head/seo.html" . }}{{ end }}
{{ block "head/favicons" . }}{{ partial "head/favicons.html" . }}{{ end }} {{ block "head/favicons" . }}{{ partial "head/favicons.html" . }}{{ end }}
{{ block "head/script-header" . }}{{ partial "head/script-header.html" . }}{{ end }} {{ block "head/script-header" . }}{{ partial "head/script-header.html" . }}{{ end }}
</head> </head>

View File

@ -0,0 +1 @@
<button class="btn-clipboard btn btn-sm btn-link" data-clipboard-text="{{ .Get "text" | safeHTML }}"><span class="copy-status"></span></button>

View File

@ -6,7 +6,6 @@
HUGO_VERSION = "0.78.0" HUGO_VERSION = "0.78.0"
NODE_VERSION = "15.0.1" NODE_VERSION = "15.0.1"
NPM_VERSION = "7.0.5" NPM_VERSION = "7.0.5"
YARN_VERSION = "1.22.5"
[context.production] [context.production]
command = "hugo -b $URL --gc --minify && npm run build:functions" command = "hugo -b $URL --gc --minify && npm run build:functions"

77
package-lock.json generated
View File

@ -13,6 +13,7 @@
"@fullhuman/postcss-purgecss": "^3.0", "@fullhuman/postcss-purgecss": "^3.0",
"autoprefixer": "^10.0", "autoprefixer": "^10.0",
"bootstrap": "^4.5", "bootstrap": "^4.5",
"clipboard": "^2.0.6",
"eslint": "^7.14", "eslint": "^7.14",
"flexsearch": "^0.6.32", "flexsearch": "^0.6.32",
"instant.page": "^5.1", "instant.page": "^5.1",
@ -2795,6 +2796,17 @@
"node": ">=0.10.0" "node": ">=0.10.0"
} }
}, },
"node_modules/clipboard": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.6.tgz",
"integrity": "sha512-g5zbiixBRk/wyKakSwCKd7vQXDjFnAMGHoEyBogG/bw9kTD9GvdAvaoRR1ALcEzt3pVKxZR0pViekPMIS0QyGg==",
"dev": true,
"dependencies": {
"good-listener": "^1.2.2",
"select": "^1.1.2",
"tiny-emitter": "^2.0.0"
}
},
"node_modules/cliui": { "node_modules/cliui": {
"version": "7.0.4", "version": "7.0.4",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
@ -3658,6 +3670,12 @@
"node": ">=0.10.0" "node": ">=0.10.0"
} }
}, },
"node_modules/delegate": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz",
"integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==",
"dev": true
},
"node_modules/depd": { "node_modules/depd": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
@ -5859,6 +5877,15 @@
"node": ">=0.6.0" "node": ">=0.6.0"
} }
}, },
"node_modules/good-listener": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz",
"integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=",
"dev": true,
"dependencies": {
"delegate": "^3.1.2"
}
},
"node_modules/graceful-fs": { "node_modules/graceful-fs": {
"version": "4.2.4", "version": "4.2.4",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz",
@ -9849,6 +9876,12 @@
"node": ">=6.0.0" "node": ">=6.0.0"
} }
}, },
"node_modules/select": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz",
"integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=",
"dev": true
},
"node_modules/semver": { "node_modules/semver": {
"version": "5.7.1", "version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
@ -11486,6 +11519,12 @@
"node": ">=0.6.0" "node": ">=0.6.0"
} }
}, },
"node_modules/tiny-emitter": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
"integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==",
"dev": true
},
"node_modules/to-arraybuffer": { "node_modules/to-arraybuffer": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz",
@ -14765,6 +14804,17 @@
} }
} }
}, },
"clipboard": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.6.tgz",
"integrity": "sha512-g5zbiixBRk/wyKakSwCKd7vQXDjFnAMGHoEyBogG/bw9kTD9GvdAvaoRR1ALcEzt3pVKxZR0pViekPMIS0QyGg==",
"dev": true,
"requires": {
"good-listener": "^1.2.2",
"select": "^1.1.2",
"tiny-emitter": "^2.0.0"
}
},
"cliui": { "cliui": {
"version": "7.0.4", "version": "7.0.4",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
@ -15466,6 +15516,12 @@
"isobject": "^3.0.1" "isobject": "^3.0.1"
} }
}, },
"delegate": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz",
"integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==",
"dev": true
},
"depd": { "depd": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
@ -17233,6 +17289,15 @@
"minimist": "^1.2.5" "minimist": "^1.2.5"
} }
}, },
"good-listener": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz",
"integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=",
"dev": true,
"requires": {
"delegate": "^3.1.2"
}
},
"graceful-fs": { "graceful-fs": {
"version": "4.2.4", "version": "4.2.4",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz",
@ -20363,6 +20428,12 @@
"lodash": "^4.17.4" "lodash": "^4.17.4"
} }
}, },
"select": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz",
"integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=",
"dev": true
},
"semver": { "semver": {
"version": "5.7.1", "version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
@ -21697,6 +21768,12 @@
"setimmediate": "^1.0.4" "setimmediate": "^1.0.4"
} }
}, },
"tiny-emitter": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
"integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==",
"dev": true
},
"to-arraybuffer": { "to-arraybuffer": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz",

View File

@ -6,6 +6,7 @@
"defaults" "defaults"
], ],
"scripts": { "scripts": {
"init": "rimraf .git && git init -b main",
"start": "hugo server", "start": "hugo server",
"build": "hugo --gc --minify && npm run build:functions", "build": "hugo --gc --minify && npm run build:functions",
"build:functions": "netlify-lambda build assets/lambda", "build:functions": "netlify-lambda build assets/lambda",
@ -25,6 +26,7 @@
"@fullhuman/postcss-purgecss": "^3.0", "@fullhuman/postcss-purgecss": "^3.0",
"autoprefixer": "^10.0", "autoprefixer": "^10.0",
"bootstrap": "^4.5", "bootstrap": "^4.5",
"clipboard": "^2.0.6",
"eslint": "^7.14", "eslint": "^7.14",
"flexsearch": "^0.6.32", "flexsearch": "^0.6.32",
"instant.page": "^5.1", "instant.page": "^5.1",
@ -38,6 +40,5 @@
"standard-version": "^9.0.0", "standard-version": "^9.0.0",
"stylelint": "^13.8", "stylelint": "^13.8",
"stylelint-config-standard": "^20.0" "stylelint-config-standard": "^20.0"
}, }
"dependencies": {}
} }