aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Shpak <alex-shpak@users.noreply.github.com>2021-09-11 21:27:19 +0200
committerAlex Shpak <alex-shpak@users.noreply.github.com>2021-09-11 21:27:19 +0200
commitd6087bd32df82e51d7631b094d1a3aa46903c1c8 (patch)
treefa3b89358fc5b0836452819dd8ff22a19bc380df
parent15ef744c94efc68b68939c27b2423986f4e263f7 (diff)
Add hugo init to install instructions
-rw-r--r--README.md20
1 files changed, 11 insertions, 9 deletions
diff --git a/README.md b/README.md
index 475038c..459988c 100644
--- a/README.md
+++ b/README.md
@@ -38,6 +38,7 @@
## Installation
+### Install as git submodule
Navigate to your hugo project root and run:
```
@@ -50,10 +51,16 @@ Then run hugo (or set `theme = "book"`/`theme: book` in configuration file)
hugo server --minify --theme book
```
-### Via Module
+### Install as hugo 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`:
+
+Start with initializing hugo modules, if not done yet:
+```
+hugo mod init github.com/repo/path
+```
+
+Navigate to your hugo project root and add [module] section to your `config.toml`:
```toml
[module]
@@ -61,15 +68,10 @@ Navigate to your hugo project root and edit your `config.toml`:
path = 'github.com/alex-shpak/hugo-book'
```
-Then, to load/update the theme module, run:
+Then, to load/update the theme module and run hugo:
```sh
hugo mod get -u
-```
-
-Finally, run hugo:
-
-```sh
hugo server --minify
```
@@ -95,7 +97,7 @@ hugo server --minify --theme book
By default, the theme will render pages from the `content/docs` section as a menu in a tree structure.
You can set `title` and `weight` in the front matter of pages to adjust the order and titles in the menu.
-### Leaf bundle menu
+### Leaf bundle menu (Deprecated)
You can also use leaf bundle and the content of its `index.md` file as menu.
Given you have the following file structure: