@@ -61,17 +61,23 @@ your environment in our
6161guide.
6262
6363Once you've made your working copy of the site repo, from the repo root folder,
64- first install the npm dependencies, including the Bootstrap and Font Awesome
65- assets that the theme sources as npm packages:
64+ install the npm dependencies, including the Bootstrap and Font Awesome assets
65+ that the theme sources as npm packages:
6666
6767``` bash
68- npm run install:all
68+ npm install
6969```
7070
71+ Because this site fetches Hugo itself from npm and discovers the theme's npm
72+ assets through Hugo modules, a ` postinstall ` hook runs ` hugo mod npm pack ` and a
73+ second install, so this single ` npm install ` sets everything up. Because that
74+ runs a Hugo module command, ` npm install ` requires the ` go ` command; see
75+ [ Troubleshooting] ( #troubleshooting ) if it fails.
76+
7177Then run:
7278
7379``` bash
74- hugo server
80+ hugo serve
7581```
7682
7783## Running a container locally
@@ -121,17 +127,18 @@ Make sure your installed go version is `1.18` or higher.
121127
122128Clone the latest version of the docsy theme into the parent folder of your
123129project. The newly created repo should now reside in a sibling folder of your
124- site's root folder.
130+ site's root folder. Replace _ ` VERSION ` _ with the version you want to use, for
131+ example ` v0.16.0 ` :
125132
126133``` shell
127134cd root-of-your-site
128- git clone --branch v0.12.0 https://github.com/google/docsy.git ../docsy
135+ git clone --branch VERSION https://github.com/google/docsy.git ../docsy
129136```
130137
131138Now run:
132139
133140``` shell
134- HUGO_MODULE_WORKSPACE=docsy.work hugo server --ignoreVendorPaths " **"
141+ HUGO_MODULE_WORKSPACE=docsy.work hugo serve --ignoreVendorPaths " **"
135142```
136143
137144or, when using npm, prepend ` local ` to the script you want to invoke, e.g.:
@@ -164,7 +171,7 @@ characters '//' so that this line takes effect.
164171As you run the website locally, you may run into the following error:
165172
166173``` console
167- $ hugo server
174+ $ hugo serve
168175WARN 2023/06/27 16:59:06 Module "project" is not compatible with this Hugo version; run "hugo mod graph" for more information.
169176Start building sites …
170177hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended windows/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio
@@ -180,7 +187,7 @@ of the user guide for instructions on how to install Hugo.
180187Or you may be confronted with the following error:
181188
182189``` console
183- $ hugo server
190+ $ hugo serve
184191
185192INFO 2021/01/21 21:07:55 Using config file:
186193Building sites … INFO 2021/01/21 21:07:55 syncing static files to /
@@ -196,13 +203,15 @@ of the user guide for instructions on how to install Hugo.
196203Or you may encounter the following error:
197204
198205``` console
199- $ hugo server
206+ $ hugo serve
200207
201208Error: failed to download modules: binary with name "go" not found
202209```
203210
204211This error occurs if the ` go ` programming language is not available on your
205- system. See this
212+ system. Because ` npm install ` runs ` hugo mod npm pack ` (via a ` postinstall `
213+ hook), this can also surface during installation, not only when serving. See
214+ this
206215[ section] ( https://www.docsy.dev/docs/get-started/docsy-as-module/installation-prerequisites/#install-go-language )
207216of the user guide for instructions on how to install ` go ` .
208217
0 commit comments