2018-08-13 18:04:44 +02:00
+++
weight = 21
+++
# Configuration
2018-08-13 18:54:46 +02:00
Place configuration values in `config.toml` or a presentation's front matter (`_index.md`).
2018-08-13 18:04:44 +02:00
---
## Reveal.js themes
2018-08-13 18:54:46 +02:00
Themes control the look and feel of your presentation. Set the `theme` param to any [valid Reveal.js theme ](https://github.com/hakimel/reveal.js/#theming ).
2018-08-13 18:04:44 +02:00
```toml
[params.reveal_hugo]
theme = "moon"
```
---
## Use a custom theme
2018-08-13 18:54:46 +02:00
To use a custom Reveal.js theme, place the CSS file in the `static` directory and set the `custom_theme` param.
2018-08-13 18:04:44 +02:00
```toml
[params.reveal_hugo]
custom_theme = "reveal-hugo/themes/robot-lung.css"
```
---
2018-08-13 18:54:46 +02:00
## Bundled themes
2018-08-13 18:04:44 +02:00
reveal-hugo comes with 2 extra Reveal.js themes:
- [robot-lung ](https://github.com/dzello/revealjs-themes#robot-lung ) (this one)
- [sunblind ](https://github.com/dzello/revealjs-themes#sunblind )
< br >
< small >
They live in the `static/reveal-hugo/themes` folder and also [on Github ](https://github.com/dzello/revealjs-themes ).
< / small >
---
## Reveal.js params
Set **snakecase** versions of Reveal.js params, which will be camelized and passed to `Reveal.initialize` .
```toml
[params.reveal_hugo]
history = true
slide_number = true
transition = 'zoom'
transition_speed = 'fast'
```
[Full list of params ](https://github.com/hakimel/reveal.js/#configuration )
---
2018-08-13 18:54:46 +02:00
## highlight.js themes
To change the syntax highlighting theme, set the `highlight_theme`
to a valid [highlight.js theme name ](https://highlightjs.org/static/demo/ ).
```toml
[params.reveal_hugo]
highlight_theme = "zenburn"
```
---
2018-08-13 18:04:44 +02:00
## Extending the layout
2018-08-13 18:54:46 +02:00
Use partials to add HTML to the page for one or all presentations at a time.
2018-08-13 18:04:44 +02:00
2018-08-13 18:54:46 +02:00
< small >
💡 This is the recommended way to add script and style tags to customize your presentations.
< / small >
2018-08-13 18:04:44 +02:00
---
2018-10-09 02:25:07 +02:00
Here is where to put partials for different presentations and places in the DOM.
2018-08-13 18:04:44 +02:00
< br > < br >
| Presentation | Before < /head> | Before < /body> |
|--------------|---------------------------------|---------------------------------|
| All | reveal-hugo/head.html | reveal-hugo/body.html |
| Root | home/reveal-hugo/head.html | home/reveal-hugo/body.html |
| Section | {section}/reveal-hugo/head.html | {section}/reveal-hugo/body.html |
2018-10-09 02:25:07 +02:00
< small >
💡 You can also create an `end.html` to put content before the end of the `.reveal` div tag.
< / small >
2018-08-13 18:04:44 +02:00
---
2018-08-13 23:55:34 +02:00
## Custom CSS Example
2018-08-13 18:04:44 +02:00
In `home/reveal-hugo/head.html` :
```html
< style >
.reveal section h1 {
color: blue;
}
< / style >
```
2018-08-13 23:55:34 +02:00
---
## Custom JS Example
2018-08-13 18:04:44 +02:00
In `home/reveal-hugo/body.html` :
```html
< script type = "text/javascript" >
Reveal.addEventListener('slidechanged', function(event) {
console.log("🎞️ Slide is now " + event.indexh);
});
< / script >
```