Skip to content

Commit

Permalink
README.md: add how to update reveal-hugo theme (when used as hugo mod…
Browse files Browse the repository at this point in the history
…ule)
  • Loading branch information
deining committed Dec 31, 2022
1 parent da4525c commit 4c711bb
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 12 deletions.
35 changes: 24 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ git init

### Get the `reveal-hugo` theme

#### Route 1 (recommended): use theme as hugo module
#### Method 1 (recommended): use theme as hugo module

Turn your new skeleton site into a hugo module by issuing this command from site root:

Expand All @@ -106,7 +106,7 @@ Open `config.toml` and add the following line:
theme = ["github.com/dzello/reveal-hugo"]
```

#### Route 2 (traditional): use theme as git submodule
#### Method 2 (traditional): use theme as git submodule

Add the `reveal-hugo` theme as a submodule in the themes directory:

Expand Down Expand Up @@ -172,14 +172,32 @@ This is my first slide.
This is my second slide.
```

### Cloning an existing repository (route 2 only)
### Cloning an existing repository (method 2 only)

If you have an existing repository that was setup with the above steps, you have to pull in the theme submodule after cloning your repository using the following command:

```shell
git submodule update --init
```

## Theme update (method 1 only)

When making use of `reveal-hugo` theme as hugo module, updating your theme is really easy:

At the command prompt, change to the root directory of your existing site.

```
cd /path/to/my-presentation
```

Then invoke hugo's module `get` subcommand with the update flag `-u`:

```
hugo mod get -u github.com/dzello/reveal-hugo
```

Hugo will automatically pull in the latest theme version. That's it, your update is done!

## Usage

The Usage guide is contained in the example presentation that lives in this repository in the [exampleSite](./exampleSite) directory. You can access a live version at [reveal-hugo.dzello.com](https://reveal-hugo.dzello.com/).
Expand Down Expand Up @@ -548,12 +566,7 @@ If your Hugo site already has a theme but you'd like to create a presentation fr

### Get the `reveal-hugo` theme

#### Hugo 0.42 and higher

As of Hugo 0.42, Hugo features [theme inheritance](https://gohugo.io/news/0.42-relnotes/).
This makes it really easy to add `reveal-hugo` to an existing site:

##### Route 1 (recommended): use theme as hugo module
#### Method 1 (recommended): use theme as hugo module

On your site root, check for the existence of a file `go.mod` which marks your site as hugo module.
If this file is not present yet, create it by issuing this command from site root:
Expand All @@ -574,7 +587,7 @@ Open `config.toml`, look for the line `theme = ...` and add `reveal-hugo` to you
theme = ["your-current-theme", "github.com/dzello/reveal-hugo"]
```

##### Route 2 (traditional): use theme as git submodule
#### Method 2 (traditional): use theme as git submodule

Add the `reveal-hugo` theme as a submodule in the themes directory:

Expand All @@ -588,7 +601,7 @@ Open `config.toml`, look for the line `theme = ...` and add `reveal-hugo` to you
theme = ["your-current-theme", "reveal-hugo"]
```

#### With Hugo versions below 0.42
#### Note: Use of Hugo versions below 0.42

With hugo < v0.42, you have to manually copy a few files out of this theme into a few of your site's directories:

Expand Down
5 changes: 5 additions & 0 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,8 @@ history = true
[params.reveal_hugo.templates.grey]
background = "#424242"
transition = "convex"

[module]
# needs hugo v0.109.0 or higher and go 1.18 or higher:
# uncomment line below for local development of module
# workspace = "hugo.work"
4 changes: 3 additions & 1 deletion exampleSite/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ module github.com/dzello/reveal-hugo/exampleSite

go 1.12

require github.com/dzello/reveal-hugo v0.0.0-20220224002855-eae99411d91a // indirect
require github.com/dzello/reveal-hugo v0.0.0-20221228063604-4c190e12065e // indirect

replace github.com/dzello/reveal-hugo => ../
2 changes: 2 additions & 0 deletions exampleSite/go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
github.com/dzello/reveal-hugo v0.0.0-20220224002855-eae99411d91a h1:qHXMoi8lo+F2w0ZFnsKTx5ov7Tkl/TjmGmmRb3POMH0=
github.com/dzello/reveal-hugo v0.0.0-20220224002855-eae99411d91a/go.mod h1:0S5eDEdHBx8tSj8veo9lUnuJRXa8WqmpANd0Lz7CLc8=
github.com/dzello/reveal-hugo v0.0.0-20221228063604-4c190e12065e h1:LQvRSfgRghe5G1hfIAgWA4HTSOWe7WysTp/j1PiNdwg=
github.com/dzello/reveal-hugo v0.0.0-20221228063604-4c190e12065e/go.mod h1:0S5eDEdHBx8tSj8veo9lUnuJRXa8WqmpANd0Lz7CLc8=
3 changes: 3 additions & 0 deletions exampleSite/hugo.work
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
go 1.19

use ../

0 comments on commit 4c711bb

Please sign in to comment.