diff --git a/README.md b/README.md index fb11fbf..6dd4640 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,9 @@ Customize the Reveal.js presentation by setting these values in `config.toml` or - `params.reveal_hugo.theme`: The Reveal.js theme used, defaults to "black" - `params.reveal_hugo.highlight_theme`: The [highlight.js](https://highlightjs.org/) theme used, defaults to "default" -Include any other attributes in `params.reveal_hugo` that you'd like to be fed as arguments to `Reveal.initialize`. See the [extensive list of Reveal.js configuration options](https://github.com/hakimel/reveal.js/#configuration) here. The defaults used by this theme are located in `data/reveal_hugo.toml`. +Include any other attributes in `params.reveal_hugo` that you'd like to be fed as arguments to `Reveal.initialize` in **snakecase**. So `slideNumber` becomes `slide_number`. The reason is that Hugo lowercases all params and Reveal.js is case-sensitive. Params are converted from snakecase to camelcase before passing to Reveal.js. + +See the [extensive list of Reveal.js configuration options](https://github.com/hakimel/reveal.js/#configuration) here. The defaults used by this theme are located in `data/reveal_hugo.toml`. If you're new to TOML, this is how it should look in your `config.toml`: diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md index b59662a..3334aa1 100644 --- a/exampleSite/content/_index.md +++ b/exampleSite/content/_index.md @@ -1,6 +1,8 @@ +++ title = "reveal-hugo features and usage" outputs = ["Reveal"] +[reveal_hugo] +slide_number = true +++ # reveal-hugo diff --git a/exampleSite/content/home/usage.md b/exampleSite/content/home/usage.md index 5dc21d3..41efdc0 100644 --- a/exampleSite/content/home/usage.md +++ b/exampleSite/content/home/usage.md @@ -19,6 +19,35 @@ isHTML = true --- +## Configure themes + +Optional. In `config.toml` or front matter. + +```toml +[params.reveal_hugo] +theme = "moon" +highlight_theme = "zenburn" +``` + +[Reveal themes](https://github.com/hakimel/reveal.js/#theming) · +[highlight.js themes](https://highlightjs.org/static/demo/) + +--- + +## Configure Reveal.js + +Set **snakecase** versions of Reveal.js params, which will be passed to `Reveal.initialize`. + +```toml +[params.reveal_hugo] +slide_number = true +transition_speed = 'fast' +``` + +[Reveal config params](https://github.com/hakimel/reveal.js/#configuration) + +--- + ## Presentation for `/` In `content/_index.md`: diff --git a/layouts/_default/baseof.reveal.html b/layouts/_default/baseof.reveal.html index a406b90..3c5081c 100644 --- a/layouts/_default/baseof.reveal.html +++ b/layouts/_default/baseof.reveal.html @@ -50,16 +50,34 @@ {{ partial "reveal-hugo/body" . }}