-
Notifications
You must be signed in to change notification settings - Fork 683
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
Add NPM script in support of local builds via sibling folder #227
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -13,13 +13,15 @@ | |||
"_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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -13,13 +13,15 @@ | |||
"_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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
docsy
anddocsy-example
are 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