aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael T Lombardi (He/Him) <michael.t.lombardi@outlook.com>2021-09-07 15:05:33 -0500
committerGitHub <noreply@github.com>2021-09-07 22:05:33 +0200
commit6aef8ef1c7760b6865d4ce8b07a9e832a2bd4974 (patch)
treee9a81ac31db3af9de48812a27de85082b2a42355
parenta656d711bf1316ed16208d0b3ceb8b8ef5f626cf (diff)
(GH-375) Enable use as a hugo module (#376)
This commit does the minimal work to make the Book theme a functional hugo module by adding the go.mod file and including instructions in the project README for use. Resolves #375
-rw-r--r--README.md23
-rw-r--r--go.mod3
2 files changed, 26 insertions, 0 deletions
diff --git a/README.md b/README.md
index fb731a4..475038c 100644
--- a/README.md
+++ b/README.md
@@ -50,6 +50,29 @@ Then run hugo (or set `theme = "book"`/`theme: book` in configuration file)
hugo server --minify --theme book
```
+### Via Module
+
+You can also add this theme as a Hugo module instead of a git submodule.
+Navigate to your hugo project root and edit your `config.toml`:
+
+```toml
+[module]
+[[module.imports]]
+path = 'github.com/alex-shpak/hugo-book'
+```
+
+Then, to load/update the theme module, run:
+
+```sh
+hugo mod get -u
+```
+
+Finally, run hugo:
+
+```sh
+hugo server --minify
+```
+
### Creating site from scratch
Below is an example on how to create a new site from scratch:
diff --git a/go.mod b/go.mod
new file mode 100644
index 0000000..3e9c89b
--- /dev/null
+++ b/go.mod
@@ -0,0 +1,3 @@
+module github.com/alex-shpak/hugo-book
+
+go 1.16