Skip to content
This repository has been archived by the owner on Sep 28, 2023. It is now read-only.

Commit

Permalink
feat: update for doks v0.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
h-enk committed Apr 2, 2021
1 parent 1bced68 commit e517462
Show file tree
Hide file tree
Showing 17 changed files with 341 additions and 340 deletions.
1 change: 1 addition & 0 deletions config/_default/config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
baseurl = "/"
canonifyURLs = false
disableAliases = true
disableHugoGeneratorInject = true
enableEmoji = true
Expand Down
6 changes: 0 additions & 6 deletions config/_default/menus.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
identifier = "prologue"
url = "/docs/prologue/"

[[docs]]
name = "Examples"
weight = 20
identifier = "examples"
url = "/docs/examples/"

[[docs]]
name = "Help"
weight = 60
Expand Down
2 changes: 2 additions & 0 deletions config/next/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
baseurl = "https://doks-child-theme-next.netlify.app/"
canonifyURLs = true
3 changes: 2 additions & 1 deletion config/production/config.toml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
baseurl = "/"
baseurl = "https://doks-child-theme.netlify.app/"
canonifyURLs = true
Empty file removed config/staging/.gitkeep
Empty file.
9 changes: 0 additions & 9 deletions content/docs/examples/_index.md

This file was deleted.

79 changes: 0 additions & 79 deletions content/docs/examples/code.md

This file was deleted.

46 changes: 0 additions & 46 deletions content/docs/examples/math.md

This file was deleted.

4 changes: 3 additions & 1 deletion content/docs/help/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ toc: true

## Hyas?

Doks is a [Hyas theme](https://gethyas.com/themes/doks/) build by the creator of Hyas.
Doks is a [Hyas theme](https://gethyas.com/themes/) build by the creator of Hyas.

## Footer notice?

Expand All @@ -39,10 +39,12 @@ Create a topic:

- [Netlify Community](https://community.netlify.com/)
- [Hugo Forums](https://discourse.gohugo.io/)
- [Doks Discussions](https://github.com/h-enk/doks/discussions)

## Contact the creator?

Send `h-enk` a message:

- [Netlify Community](https://community.netlify.com/)
- [Hugo Forums](https://discourse.gohugo.io/)
- [Doks Discussions](https://github.com/h-enk/doks/discussions)
16 changes: 12 additions & 4 deletions content/docs/help/how-to-update.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ date: 2020-11-12T13:26:54+01:00
lastmod: 2020-11-12T13:26:54+01:00
draft: false
images: []
menu:
menu:
docs:
parent: "help"
weight: 610
Expand All @@ -15,10 +15,18 @@ 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
## Check for outdated packages

Bump the versions in the `devDependencies` section of `./package.json` to your liking, and run:
The [`npm outdated`](https://docs.npmjs.com/cli/v7/commands/npm-outdated) command will check the registry to see if any (or, specific) installed packages are currently outdated:

```bash
npm update
npm outdated [[<@scope>/]<pkg> ...]
```

## Update packages

The [`npm update`](https://docs.npmjs.com/cli/v7/commands/npm-update) command will update all the packages listed to the latest version (specified by the tag config), respecting semver:

```bash
npm update [<pkg>...]
```
22 changes: 17 additions & 5 deletions content/docs/prologue/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ date: 2020-10-13T15:21:01+02:00
lastmod: 2020-10-13T15:21:01+02:00
draft: false
images: []
menu:
menu:
docs:
parent: "prologue"
weight: 130
Expand All @@ -15,16 +15,18 @@ toc: true

{{< alert icon="💡" text="You can change the commands in the scripts section of `./package.json`." >}}

## start
## create

Start local development server:
Create new content for your site:

{{< btn-copy text="npm run start" >}}
{{< btn-copy text="npm run create" >}}

```bash
npm run start
npm run create [path] [flags]
```

See also the Hugo docs: [hugo new](https://gohugo.io/commands/hugo_new/).

## lint

Check scripts, styles, and markdown for errors:
Expand Down Expand Up @@ -75,6 +77,16 @@ Delete temporary directories:
npm run clean
```

## start

Start local development server:

{{< btn-copy text="npm run start" >}}

```bash
npm run start
```

## build

Build production website:
Expand Down
8 changes: 4 additions & 4 deletions content/docs/prologue/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Step-by-step instructions on how to start a new Doks project. [Tutorial →](htt

{{< alert icon="👉" text="The Quick Start is intended for intermediate to advanced users." >}}

One page summary of how to start a new Doks project. [Quick Start →]({{< ref "quick-start" >}})
One page summary of how to start a new Doks project. [Quick Start →]({{< relref "quick-start" >}})

## Go further

Expand All @@ -43,16 +43,16 @@ Learn how to customize Doks to fully make it your own. [Reference Guides →](ht

### Extensions

Get instructions on how to add even more to Doks. [Extensions →](https://getdoks.org/docs/extensions/add-google-fonts/)
Get instructions on how to add even more to Doks. [Extensions →](https://getdoks.org/docs/extensions/breadcrumb-navigation/)

### Showcase

See what others have build with Doks. [Showcase →](https://getdoks.org/showcase/parietal-numerics-documentation/)
See what others have build with Doks. [Showcase →](https://getdoks.org/showcase/electric-blocks/)

## Contributing

Find out how to contribute to Doks. [Contributing →](https://getdoks.org/docs/contributing/how-to-contribute/)

## Help

Get help on Doks. [Help →]({{< ref "how-to-update" >}})
Get help on Doks. [Help →]({{< relref "how-to-update" >}})
23 changes: 21 additions & 2 deletions content/docs/prologue/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,33 @@ toc: true

## Requirements

Doks uses npm to install dependencies and run commands. Installing npm is pretty simple. Download and install [Node.js](https://nodejs.org/) (it includes npm) for your platform.
Doks uses npm to centralize dependency management, making it [easy to update]({{< relref "how-to-update" >}}) resources, build tooling, plugins, and build scripts:

- Download and install [Node.js](https://nodejs.org/) (it includes npm) for your platform.

## Start a new Doks project

Create a new site, change directories, install dependencies, and start development server.

### Create a new site

Doks is available as a child theme, and a starter theme:

- Use the Doks child theme, if you do __not__ plan to customize a lot, and/or need future Doks updates.
- Use the Doks starter theme, if you plan to customize a lot, and/or do __not__ need future Doks updates.

Not quite sure? Use the Doks child theme.

#### Doks child theme

{{< btn-copy text="git clone https://github.com/h-enk/doks-child-theme.git my-doks-site" >}}

```bash
git clone https://github.com/h-enk/doks-child-theme.git my-doks-site
```

#### Doks starter theme

{{< btn-copy text="git clone https://github.com/h-enk/doks.git my-doks-site" >}}

```bash
Expand Down Expand Up @@ -57,4 +76,4 @@ Doks will start the Hugo development webserver accessible by default at `http://

## Other commands

Doks comes with commands for common tasks. [Commands →]({{< ref "commands" >}})
Doks comes with commands for common tasks. [Commands →]({{< relref "commands" >}})
6 changes: 3 additions & 3 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ <h1 class="mt-0">{{ .Title }}</h1>
</div>
<div class="col-lg-9 col-xl-8 text-center">
<p class="lead">{{ .Params.lead | safeHTML }}</p>
<a class="btn btn-primary btn-lg px-4 mb-2" href="{{ "docs/prologue/introduction/" | absURL }}" role="button">Get started</a>
<a class="btn btn-primary btn-lg px-4 mb-2" href="{{ "docs/prologue/introduction/" | relURL }}" role="button">Get started</a>
<p class="meta">Open-source MIT Licensed. <a href="https://github.com/h-enk/doks">GitHub v{{ .Site.Data.doks.version }}</a></p>
</div>
</div>
Expand All @@ -19,10 +19,10 @@ <h1 class="mt-0">{{ .Title }}</h1>
<div class="row justify-content-center text-center">
<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>
<p>Get A+ scores on <a href="https://observatory.mozilla.org/analyze/doks-child-theme.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>
<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">
Expand Down
24 changes: 15 additions & 9 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,29 @@
publish = "public"
functions = "functions"

[dev]
framework = "#custom"
command = "npx hugo server --disableFastRender"
targetPort = 1313
port = 8888
publish = "public"
autoLaunch = false

[build.environment]
NODE_VERSION = "15.5.1"
NPM_VERSION = "7.3.0"

[context.production]
command = "npx hugo --gc --minify -b $URL && npm run build:functions"
command = "npx hugo --gc --minify && npx netlify-lambda build assets/lambda"

[context.deploy-preview]
command = "npx hugo --gc --minify -b $DEPLOY_PRIME_URL"

[context.branch-deploy]
command = "npx hugo --gc --minify -b $DEPLOY_PRIME_URL"

[context.next]
command = "npx hugo --gc --minify && npx netlify-lambda build assets/lambda"

[context.next.environment]
HUGO_ENV = "next"

[dev]
framework = "#custom"
command = "npx rimraf public resources functions && npx hugo server --bind=0.0.0.0 --disableFastRender"
targetPort = 1313
port = 8888
publish = "public"
autoLaunch = false
Loading

0 comments on commit e517462

Please sign in to comment.