Skip to content

Commit

Permalink
NPM script refactoring and README cmd adjustment (#893)
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin committed Feb 14, 2022
1 parent eb4fcb0 commit 438b56d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
17 changes: 7 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@ being maintained.

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

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

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

```console
$ sudo npm install -D --save autoprefixer
$ sudo npm install -D --save postcss-cli
$ npm install --save-dev autoprefixer
$ npm install --save-dev postcss-cli
```

## Example and usage
Expand Down Expand Up @@ -59,12 +58,10 @@ above:
```console
$ git clone --recurse-submodules --depth 1 https://github.com/google/docsy.git
$ cd docsy/userguide/
$ hugo server --themesDir ../..
$ npm install
$ npm run serve
```

Note: you need the `themesDir` flag when running Hugo because the site files are
inside the theme repo.

## Contributing ![GitHub](https://img.shields.io/github/contributors/google/docsy)

Please read
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"scripts": {
"build:preview": "cd userguide && npm run build:preview",
"build:production": "cd userguide && npm run build:production",
"build": "cd userguide && npm run build",
"install": "cd userguide && npm install",
"serve": "cd userguide && npm run serve",
"_docs": "cd userguide && npm run",
"docs-install": "cd userguide && npm install",
"build:preview": "npm run _docs build:preview",
"build:production": "npm run _docs build:production",
"build": "npm run _docs build",
"serve": "npm run _docs serve",
"submodule:get": "git submodule update --init --recursive --depth 1",
"submodule:update": "git submodule update --remote --recursive --depth 1"
},
Expand Down
10 changes: 6 additions & 4 deletions userguide/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"scripts": {
"_build": "hugo --cleanDestinationDir -e dev -DFE --themesDir ../..",
"_serve": "hugo serve -DFE --themesDir ../..",
"build:preview": "hugo --cleanDestinationDir -e dev -DFE --minify --baseURL \"${DEPLOY_PRIME_URL:-/}\" --themesDir ../..",
"build:production": "hugo --cleanDestinationDir --minify --themesDir ../..",
"_build": "npm run _hugo-dev",
"_hugo": "hugo --cleanDestinationDir --themesDir ../..",
"_hugo-dev": "npm run _hugo -- -e dev -DFE",
"_serve": "npm run _hugo-dev -- serve",
"build:preview": "npm run _hugo-dev -- --minify --baseURL \"${DEPLOY_PRIME_URL:-/}\"",
"build:production": "npm run _hugo -- --minify",
"build": "npm run _build",
"prebuild:preview": "npm run submodule:get",
"prebuild:production": "npm run submodule:get",
Expand Down

0 comments on commit 438b56d

Please sign in to comment.