Website Summary Files Commits Branches @commit @diff @stats
path: root / website / themes / reveal-hugo / exampleSite / content / home / configuration.md
blob: 1d13e9bb0973b56d851b2584b0ae0aeb7b14cd34 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
+++
weight = 21
+++

# Configuration

Place configuration values in `config.toml` or a presentation's front matter (`_index.md`).

---

## Reveal.js themes

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).

```toml
[params.reveal_hugo]
theme = "moon"
```

---

## Use a custom theme

To use a custom Reveal.js theme, place the CSS file in the `static` directory and set the `custom_theme` param.

```toml
[params.reveal_hugo]
custom_theme = "reveal-hugo/themes/robot-lung.css"
```

---

### Use a custom theme (advanced)

To use Hugo pipes to build a custom Reveal.js theme, place the source file (SCSS / PostCSS) in the `assets` directory and set the `custom_theme_compile` param.

```toml
[params.reveal_hugo]
custom_theme = "reveal-hugo/themes/custom-theme.scss"
custom_theme_compile = true
```

<small>

💡 See the [custom theme example presentation](/custom-theme-example/) for more details.

</small>

---

## Bundled themes

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)

---

## 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"
```

---

## Extending the layout

Use partials to add HTML to the page for one or all presentations at a time.

<small>
💡 This is the recommended way to add script and style tags to customize your presentations.
</small>

---

Here is where to put partials for different presentations and places in the DOM.
<br><br>

| Presentation | Before &lt;/head&gt;            | Before &lt;/body&gt;            |
|--------------|---------------------------------|---------------------------------|
| 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 |

&nbsp;

<small>

💡 You can also create an `end.html` to put content before the end of the `.reveal` div tag.

</small>

---

## Custom CSS Example

In `home/reveal-hugo/head.html`:

```html
<style>
.reveal section h1 {
  color: blue;
}
</style>
```

---

## Custom JS Example

In `home/reveal-hugo/body.html`:

```html
<script type="text/javascript">
Reveal.addEventListener('slidechanged', function(event) {
  console.log("🎞️ Slide is now " + event.indexh);
});
</script>
```

---

### Extending the layout 
#### (alternative)

You can declare a custom CSS or javascript in your configuration.

```toml
[reveal_hugo]
custom_css = "css/custom.css"
custom_js = "js/custom.js"
```

<small>

These files can be located in `static/css`, `static/js` folder 

💡 See the [extending layout example](/extending-layout-example/#) for more details.

</small>