(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
This commit is contained in:
Michael T Lombardi (He/Him) 2021-09-07 15:05:33 -05:00 committed by GitHub
parent a656d711bf
commit 6aef8ef1c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 0 deletions

View file

@ -50,6 +50,29 @@ Then run hugo (or set `theme = "book"`/`theme: book` in configuration file)
hugo server --minify --theme book 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 ### Creating site from scratch
Below is an example on how to create a new site from scratch: Below is an example on how to create a new site from scratch:

3
go.mod Normal file
View file

@ -0,0 +1,3 @@
module github.com/alex-shpak/hugo-book
go 1.16