Skip to content

Commit

Permalink
Add hugo init to install instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-shpak committed Sep 11, 2021
1 parent 15ef744 commit d6087bd
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

## Installation

### Install as git submodule
Navigate to your hugo project root and run:

```
Expand All @@ -50,26 +51,27 @@ 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]
[[module.imports]]
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
```

Expand All @@ -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:
Expand Down

0 comments on commit d6087bd

Please sign in to comment.