Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPM script refactoring and README cmd adjustment #893

Merged
merged 1 commit into from
Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that I removed the "(we recommend version 0.53 or later)", leaving at "a recent release" for now.

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