Add NPM script in support of local builds via sibling folder#227
Add NPM script in support of local builds via sibling folder#227chalin wants to merge 1 commit intogoogle:mainfrom
Conversation
deining
left a comment
There was a problem hiding this comment.
In general, I like the idea of having a local copy of the docsy theme at hand.
I had this need/idea already before and authored PR #194 which addresses this issue (incl. documentation). This PR is not fully up to date any more but if you like it and if there is the prospect that my PR will be merged, I am willing to rework my PR #194.
| "_check:links": "echo IMPLEMENTATION PENDING for check-links; echo", | ||
| "_hugo": "hugo --cleanDestinationDir", | ||
| "_hugo-dev": "npm run _hugo -- -e dev -DFE", | ||
| "_local": "HUGO_MODULE_REPLACEMENTS=\"github.com/google/docsy -> ../../docsy\"", |
There was a problem hiding this comment.
What about using environment variable HUGO_MODULE_WORKSPACE here:
"_local": "HUGO_MODULE_WORKSPACE=\"hugo.work\"",
If we make use of go wrkspaces here, the path is not hardcoded into package.json, instead users can customize the path according to their needs by editing the file hugo.work.
Have a look at PR #194 which makes use of this concept.
| "_check:links": "echo IMPLEMENTATION PENDING for check-links; echo", | ||
| "_hugo": "hugo --cleanDestinationDir", | ||
| "_hugo-dev": "npm run _hugo -- -e dev -DFE", | ||
| "_local": "HUGO_MODULE_REPLACEMENTS=\"github.com/google/docsy -> ../../docsy\"", |
There was a problem hiding this comment.
Is this code cross-plattform or does this work on Linux-based OS only?
I would propose to make use of the cross-env package in order to achieve cross-platform compatibility.
|
Closing in favor of: |
If you have a development setup where
docsyanddocsy-exampleare in the same parent folder, thennpm run local -- <cmd>will run the NPM script<cmd>while using the version of docsy contained in the local folder./cc @geriom