Skip to content

Commit 438b56d

Browse files
authored
NPM script refactoring and README cmd adjustment (#893)
1 parent eb4fcb0 commit 438b56d

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

README.md

+7-10
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,17 @@ being maintained.
1010

1111
The following are basic prerequisites for using Docsy in your site:
1212

13-
- Install a recent release of the Hugo "extended" version (we recommend version
14-
0.53 or later). If you install from the [release
15-
page](https://github.com/gohugoio/hugo/releases), make sure you download the
16-
`_extended` version which supports SCSS.
13+
- Install a recent release of the Hugo "extended" version. If you install from
14+
the [Hugo release page](https://github.com/gohugoio/hugo/releases), make sure
15+
you download the `_extended` version which supports SCSS.
1716

1817
- Install `PostCSS` so that the site build can create the final CSS assets. You
1918
can install it locally by running the following commands from the root
2019
directory of your project:
2120

2221
```console
23-
$ sudo npm install -D --save autoprefixer
24-
$ sudo npm install -D --save postcss-cli
22+
$ npm install --save-dev autoprefixer
23+
$ npm install --save-dev postcss-cli
2524
```
2625

2726
## Example and usage
@@ -59,12 +58,10 @@ above:
5958
```console
6059
$ git clone --recurse-submodules --depth 1 https://github.com/google/docsy.git
6160
$ cd docsy/userguide/
62-
$ hugo server --themesDir ../..
61+
$ npm install
62+
$ npm run serve
6363
```
6464

65-
Note: you need the `themesDir` flag when running Hugo because the site files are
66-
inside the theme repo.
67-
6865
## Contributing ![GitHub](https://img.shields.io/github/contributors/google/docsy)
6966

7067
Please read

package.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"scripts": {
3-
"build:preview": "cd userguide && npm run build:preview",
4-
"build:production": "cd userguide && npm run build:production",
5-
"build": "cd userguide && npm run build",
6-
"install": "cd userguide && npm install",
7-
"serve": "cd userguide && npm run serve",
3+
"_docs": "cd userguide && npm run",
4+
"docs-install": "cd userguide && npm install",
5+
"build:preview": "npm run _docs build:preview",
6+
"build:production": "npm run _docs build:production",
7+
"build": "npm run _docs build",
8+
"serve": "npm run _docs serve",
89
"submodule:get": "git submodule update --init --recursive --depth 1",
910
"submodule:update": "git submodule update --remote --recursive --depth 1"
1011
},

userguide/package.json

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{
22
"scripts": {
3-
"_build": "hugo --cleanDestinationDir -e dev -DFE --themesDir ../..",
4-
"_serve": "hugo serve -DFE --themesDir ../..",
5-
"build:preview": "hugo --cleanDestinationDir -e dev -DFE --minify --baseURL \"${DEPLOY_PRIME_URL:-/}\" --themesDir ../..",
6-
"build:production": "hugo --cleanDestinationDir --minify --themesDir ../..",
3+
"_build": "npm run _hugo-dev",
4+
"_hugo": "hugo --cleanDestinationDir --themesDir ../..",
5+
"_hugo-dev": "npm run _hugo -- -e dev -DFE",
6+
"_serve": "npm run _hugo-dev -- serve",
7+
"build:preview": "npm run _hugo-dev -- --minify --baseURL \"${DEPLOY_PRIME_URL:-/}\"",
8+
"build:production": "npm run _hugo -- --minify",
79
"build": "npm run _build",
810
"prebuild:preview": "npm run submodule:get",
911
"prebuild:production": "npm run submodule:get",

0 commit comments

Comments
 (0)