Skip to content

Commit 6aef8ef

Browse files
(alex-shpakGH-375) Enable use as a hugo module (alex-shpak#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 alex-shpak#375
1 parent a656d71 commit 6aef8ef

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

README.md

+23
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,29 @@ Then run hugo (or set `theme = "book"`/`theme: book` in configuration file)
5050
hugo server --minify --theme book
5151
```
5252

53+
### Via Module
54+
55+
You can also add this theme as a Hugo module instead of a git submodule.
56+
Navigate to your hugo project root and edit your `config.toml`:
57+
58+
```toml
59+
[module]
60+
[[module.imports]]
61+
path = 'github.com/alex-shpak/hugo-book'
62+
```
63+
64+
Then, to load/update the theme module, run:
65+
66+
```sh
67+
hugo mod get -u
68+
```
69+
70+
Finally, run hugo:
71+
72+
```sh
73+
hugo server --minify
74+
```
75+
5376
### Creating site from scratch
5477

5578
Below is an example on how to create a new site from scratch:

go.mod

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/alex-shpak/hugo-book
2+
3+
go 1.16

0 commit comments

Comments
 (0)