Skip to content

Commit

Permalink
feat: turn anatole theme into a hugo module (#291)
Browse files Browse the repository at this point in the history
* Turn anatole theme into a hugo module
* Add documentation on using theme as module
  • Loading branch information
deining committed Jan 14, 2022
1 parent 99baec2 commit fcbc65c
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 3 deletions.
34 changes: 31 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,41 @@ hugo server --themesDir ../..

## Quick Start

### Route 1 (recommended): use theme as Hugo module

1. Install prerequisites [git](https://git-scm.com/downloads) and [go](https://go.dev/dl/) (>= 1.12)
2. Turn your Hugo Project into a Hugo module: `hugo mod init github.com/me/my-project`
3. Declare the `Anatole` module as a dependency of your site: `hugo mod get github.com/lxndrblz/anatole`
4. Add the following lines at the end of your `config.toml`:

```
[module]
# uncomment line below for temporary local development of module
# replacements = "github.com/lxndrblz/anatole -> ../../anatole"
[[module.imports]]
path = "github.com/lxndrblz/anatole"
disable = false
```
### Route 2 (traditional): install theme as Git submodule

1. Add the repository into your Hugo Project repository as a submodule: `git submodule add https://github.com/lxndrblz/anatole.git themes/anatole`.
2. Configure your `config.toml`. Feel free to copy the demo `config.toml` and some content from the exampleSite.
3. Build your site with `hugo serve` and admire the result at `http://localhost:1313/`.

### Start up your site

1. Configure your `config.toml`. Feel free to copy the demo `config.toml` and some content from the exampleSite.
2. Build your site with `hugo serve` and admire the result at `http://localhost:1313/`.

## Update your installation

If you want to get the latest update of the `Anatole` theme, please execute this command:
If you want to get the latest update of the `Anatole` theme, please follow the instructions below:

### Theme as Hugo module

```shell
hugo mod get -u github.com/lxndrblz/anatole
```

### Theme as Git submodule

```shell
git submodule update --remote --merge
Expand Down
5 changes: 5 additions & 0 deletions exampleSite/config/_default/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ baseURL = "https://example.com"
languageCode = "en"
DefaultContentLanguage = "en"
title = "Website of Jane Doe"

# theme as hugo module
#theme = "github.com/lxndrblz/anatole"
# theme as git submodule
theme = "anatole"

summarylength = 10
enableEmoji = true
enableRobotsTXT = true
Expand Down
3 changes: 3 additions & 0 deletions exampleSite/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/lxndrblz/anatole-example

go 1.12
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/lxndrblz/anatole

go 1.12

0 comments on commit fcbc65c

Please sign in to comment.