portails/content/docs/prologue/commands.md

99 lines
1.3 KiB
Markdown
Raw Normal View History

2020-11-04 08:26:58 +01:00
---
title: "Commands"
2020-12-03 16:07:04 +01:00
description: "Doks comes with commands for common tasks."
lead: "Doks comes with commands for common tasks."
2020-11-04 08:26:58 +01:00
date: 2020-10-13T15:21:01+02:00
lastmod: 2020-10-13T15:21:01+02:00
draft: false
images: []
2021-04-02 20:01:29 +02:00
menu:
2020-11-04 08:26:58 +01:00
docs:
parent: "prologue"
2020-12-03 16:07:04 +01:00
weight: 130
2020-11-04 08:26:58 +01:00
toc: true
---
{{< alert icon="💡" text="You can change the commands in the scripts section of `./package.json`." />}}
2020-11-05 21:09:30 +01:00
2021-04-02 20:01:29 +02:00
## create
2020-11-04 08:26:58 +01:00
2021-04-02 20:01:29 +02:00
Create new content for your site:
2020-11-04 08:26:58 +01:00
```bash
2021-04-02 20:01:29 +02:00
npm run create [path] [flags]
2020-11-04 08:26:58 +01:00
```
2021-04-02 20:01:29 +02:00
See also the Hugo docs: [hugo new](https://gohugo.io/commands/hugo_new/).
2020-11-05 21:09:30 +01:00
## lint
2020-11-04 08:26:58 +01:00
2020-11-05 21:09:30 +01:00
Check scripts, styles, and markdown for errors:
2020-11-04 08:26:58 +01:00
```bash
2020-11-05 21:09:30 +01:00
npm run lint
2020-11-04 08:26:58 +01:00
```
2020-11-05 21:09:30 +01:00
### scripts
Check scripts for errors:
2020-11-04 08:26:58 +01:00
```bash
2020-11-16 09:35:51 +01:00
npm run lint:scripts [-- --fix]
2020-11-04 08:26:58 +01:00
```
2020-11-05 21:09:30 +01:00
### styles
Check styles for errors:
2020-11-04 08:26:58 +01:00
```bash
2020-11-16 09:35:51 +01:00
npm run lint:styles [-- --fix]
2020-11-04 08:26:58 +01:00
```
2020-11-05 21:09:30 +01:00
### markdown
2020-11-04 08:26:58 +01:00
2020-11-05 21:09:30 +01:00
Check markdown for errors:
2020-11-04 08:26:58 +01:00
```bash
2020-11-16 09:35:51 +01:00
npm run lint:markdown [-- --fix]
2020-11-04 08:26:58 +01:00
```
## clean
Delete temporary directories:
```bash
2020-11-05 21:09:30 +01:00
npm run clean
2020-11-04 08:26:58 +01:00
```
2021-04-02 20:01:29 +02:00
## start
Start local development server:
```bash
npm run start
```
2020-11-05 21:09:30 +01:00
## build
2020-11-04 08:26:58 +01:00
2020-11-05 21:09:30 +01:00
Build production website:
2020-11-04 08:26:58 +01:00
```bash
2020-11-05 21:09:30 +01:00
npm run build
2020-11-04 08:26:58 +01:00
```
2020-11-05 21:09:30 +01:00
### functions
2020-11-04 08:26:58 +01:00
2020-11-05 21:09:30 +01:00
Build Lambda functions:
2020-11-04 08:26:58 +01:00
```bash
2020-11-05 21:09:30 +01:00
npm run build:functions
2020-11-04 08:26:58 +01:00
```
2020-11-05 21:09:30 +01:00
### preview
2020-11-04 08:26:58 +01:00
2020-11-05 21:09:30 +01:00
Build production website including draft and future content:
2020-11-04 08:26:58 +01:00
```bash
2020-11-05 21:09:30 +01:00
npm run build:preview
2020-11-04 08:26:58 +01:00
```