2021-03-18 15:50:09 +01:00
|
|
|
---
|
|
|
|
title: "Commands"
|
|
|
|
description: "Doks comes with commands for common tasks."
|
|
|
|
lead: "Doks comes with commands for common tasks."
|
|
|
|
date: 2020-10-13T15:21:01+02:00
|
|
|
|
lastmod: 2020-10-13T15:21:01+02:00
|
|
|
|
draft: false
|
|
|
|
images: []
|
2021-04-02 20:27:40 +02:00
|
|
|
menu:
|
2021-03-18 15:50:09 +01:00
|
|
|
docs:
|
|
|
|
parent: "prologue"
|
|
|
|
weight: 130
|
|
|
|
toc: true
|
|
|
|
---
|
|
|
|
|
2021-06-25 16:49:17 +02:00
|
|
|
{{< alert icon="💡" text="You can change the commands in the scripts section of `./package.json`." />}}
|
2021-03-18 15:50:09 +01:00
|
|
|
|
2021-04-02 20:27:40 +02:00
|
|
|
## create
|
2021-03-18 15:50:09 +01:00
|
|
|
|
2021-04-02 20:27:40 +02:00
|
|
|
Create new content for your site:
|
2021-03-18 15:50:09 +01:00
|
|
|
|
|
|
|
```bash
|
2021-04-02 20:27:40 +02:00
|
|
|
npm run create [path] [flags]
|
2021-03-18 15:50:09 +01:00
|
|
|
```
|
|
|
|
|
2021-04-02 20:27:40 +02:00
|
|
|
See also the Hugo docs: [hugo new](https://gohugo.io/commands/hugo_new/).
|
|
|
|
|
2022-07-09 09:46:39 +02:00
|
|
|
### Docs based tree
|
|
|
|
|
|
|
|
Create a docs based tree — with a single command:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
npm run create -- --kind docs [section]
|
|
|
|
```
|
|
|
|
|
|
|
|
For example, create a docs based tree named guides:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
npm run create -- --kind docs guides
|
|
|
|
```
|
|
|
|
|
2021-03-18 15:50:09 +01:00
|
|
|
## lint
|
|
|
|
|
|
|
|
Check scripts, styles, and markdown for errors:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
npm run lint
|
|
|
|
```
|
|
|
|
|
|
|
|
### scripts
|
|
|
|
|
|
|
|
Check scripts for errors:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
npm run lint:scripts [-- --fix]
|
|
|
|
```
|
|
|
|
|
|
|
|
### styles
|
|
|
|
|
|
|
|
Check styles for errors:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
npm run lint:styles [-- --fix]
|
|
|
|
```
|
|
|
|
|
|
|
|
### markdown
|
|
|
|
|
|
|
|
Check markdown for errors:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
npm run lint:markdown [-- --fix]
|
|
|
|
```
|
|
|
|
|
|
|
|
## clean
|
|
|
|
|
|
|
|
Delete temporary directories:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
npm run clean
|
|
|
|
```
|
|
|
|
|
2021-04-02 20:27:40 +02:00
|
|
|
## start
|
|
|
|
|
|
|
|
Start local development server:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
npm run start
|
|
|
|
```
|
|
|
|
|
2021-03-18 15:50:09 +01:00
|
|
|
## build
|
|
|
|
|
|
|
|
Build production website:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
npm run build
|
|
|
|
```
|
|
|
|
|
|
|
|
### functions
|
|
|
|
|
|
|
|
Build Lambda functions:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
npm run build:functions
|
|
|
|
```
|
|
|
|
|
|
|
|
### preview
|
|
|
|
|
|
|
|
Build production website including draft and future content:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
npm run build:preview
|
|
|
|
```
|