-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(v4) add developer scripts and guide (#585)
- Loading branch information
1 parent
3776287
commit 25aa560
Showing
9 changed files
with
113 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
clear | ||
|
||
echo | ||
echo "----------------------------------------------------------------------------" | ||
echo "This script set ups and builds the example site" | ||
echo "----------------------------------------------------------------------------" | ||
|
||
./scripts/setup-example-site.sh | ||
|
||
echo ">>> Building example site..." | ||
|
||
cd tests/local/exampleSite || return | ||
hugo --environment development --buildDrafts --buildFuture | ||
|
||
echo ">>> ... completed." | ||
exit 0 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
clear | ||
|
||
echo | ||
echo "----------------------------------------------------------------------------" | ||
echo "This script set ups and serve the example site" | ||
echo "----------------------------------------------------------------------------" | ||
|
||
./scripts/setup-example-site.sh | ||
|
||
echo ">>> Starting Hugo server..." | ||
|
||
cd tests/local/exampleSite || return | ||
hugo server --buildDrafts --buildFuture | ||
|
||
echo ">>> ... completed." | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env bash | ||
|
||
clear | ||
|
||
echo | ||
echo "----------------------------------------------------------------------------" | ||
echo "This script set ups the example site" | ||
echo "----------------------------------------------------------------------------" | ||
|
||
echo ">>> Setting up example site..." | ||
|
||
if [ -d "tests/local" ] | ||
then rm -rf tests/local | ||
fi | ||
|
||
mkdir tests/local | ||
cd tests/local || return | ||
hugo new site exampleSite | ||
rm exampleSite/archetypes/default.md | ||
cp -r ../../exampleSite/* exampleSite | ||
|
||
echo ">>> Updating 'config.toml'..." | ||
|
||
sed -i "s/title = .*$/title = \"Dev Bilberry Test\"/" exampleSite/config.toml | ||
sed -i "s/subtitle = .*$/subtitle = \"Running locally!\"/" exampleSite/config.toml | ||
sed -i "s/theme = .*$/theme = \"..\/..\/..\/..\/..\/v4\"/" exampleSite/config.toml | ||
|
||
echo ">>> ... completed." | ||
exit 0 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
## v4 Developer Guide | ||
|
||
### Prerequisites | ||
- **Hugo** (version >= 0.109.0 **extended**), see this installation [guide](https://gohugo.io/getting-started/installing/). | ||
- **Git**, see this installation [guide](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). | ||
- **Go** (version >= 1.19), see this installation [guide](https://go.dev/doc/install). | ||
- **Node.js** (version >= 20.5.0) with **npm** (version >= 9.8.0), see this | ||
installation [guide](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm). | ||
|
||
### Third-party Dependencies | ||
|
||
Third-party dependencies are managed using `npm` and listed in | ||
the [`devDependencies`](https://github.com/Lednerb/bilberry-hugo-theme/blob/3776287f2e4494c1308593bde531dbe944de6ddd/v4/package.json#L6) | ||
block of `package.json` file. | ||
|
||
* To update dependencies, adjust version numbers in the `devDependencies` bloc and execute the following command from | ||
project's `v4` folder: | ||
|
||
```bash | ||
$ npm run update-dep | ||
``` | ||
|
||
* To add a new dependency, add it to the `devDependencies` bloc and execute the `npm run update-dep` command. Then, | ||
examine the location of the new dependency's CSS and JavaScript files in the `v4/node_modules` folder. Dependencies, | ||
namely CSS and JavaScript artifacts must be copied from the `v4/node_modules` folder to the `v4/assets/sass/_vendor` | ||
and `v4/assets/js/_vendor` folders, respectively. Therefore, update the `v4/scripts/update-node-deps.sh` script and | ||
execute the `npm run update-dep` command again. For the newly copied SCSS and JavaScript artifacts to be used by Hugo | ||
pipes, they should be included in the `v4/assets/sass/theme.scss` and `v4/layouts/partials/js.html` files. Therefore, | ||
update these files accordingly, and commit the changes. | ||
|
||
### Example Site | ||
|
||
* To build the example site, execute the `npm run build-example` command. Then, examine the content of | ||
the `v4/tests/local/exampleSite/public` folder. | ||
|
||
* To run the example site, execute the `npm run serve-example` command. The example site will be available | ||
at http://localhost:1313/. | ||
|
||
* To stop all instances of the Hugo server running in your local dev, you may use the `npm run stop-hugo` command. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters