blob: 3ce5b8c27855e783c12322742ca66133527dc4f0 (
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
|
+++
weight = 34
+++
## Slide
Use this shortcode when you need to customize slide attributes like id, class, background color and transition.
---
{{< slide class="hello" >}}
## Slide
Add the shortcode above the slide's content, below the `---`.
```markdown
---
{{</* slide class="hello" */>}}
## Hello, world!
---
```
---
{{< slide transition="zoom" transition-speed="fast" >}}
## Custom slide 1
<small>Did you notice? This slide has a fast zoom transition.</small>
```markdown
---
{{</* slide transition="zoom" transition-speed="fast" */>}}
## Custom slide 1
---
```
---
{{< slide background-color="#FF4081" >}}
## Custom slide 2
<small>This slide has a different background color.</small>
```markdown
---
{{</* slide background-color="#FF4081" */>}}
## Custom slide 2
---
```
---
{{< slide background-image="/images/alex-litvin-790876-unsplash.jpg" background-color="#000000" >}}
## Custom slide 3
<small>This slide has a background image.</small>
```markdown
---
{{</* slide background-image="/images/alex-litvin-790876-unsplash.jpg" */>}}
---
```
<small>(credit <a href="https://unsplash.com/@alexlitvin">Alex Litvin</a>)</small>
---
{{< slide id="custom-slide" >}}
💡 Tip: Setting a slide's `id` attribute makes it easy to link to from other parts of the presentation.
<br><br>
```markdown
---
{{</* slide id="custom-slide" */>}}
## Custom slide
---
```
---
```markdown
[Try the link](#custom-slide)
```
<br>
[Try the link](#custom-slide)
---
Slide attribute possibilities from the [Reveal.js docs](https://github.com/hakimel/reveal.js):
- `autoslide`
- `state`
- `background`
- `background-color`
- `background-image`
- `background-size`
- `background-position`
- `background-repeat`
---
- `background-video`
- `background-video-loop`
- `background-video-muted`
- `background-interactive`
- `background-iframe`
- `background-transition`
- `transition` (can have different in and out transitions)
- `transition-speed`
- `notes` (can also use the note shortcode)
- `timing`
---
{{% section %}}
## Slide templates
Store sets of common slide attributes in front matter variables and apply them to slides with the template attribute.
<br>
<small>
navigate down to learn more
</small>
<br>
<a href="#" class="navigate-down">🔽</a>
---
Create templates in config.toml, _index.md or the current page's front matter. Put them under the **templates** key with a meaningful name:
```toml
[reveal_hugo.templates.hotpink]
class = "hotpink"
background = "#FF4081"
```
---
{{< slide template="hotpink" >}}
Apply the template using the **template** attribute of the slide shortcode:
```markdown
{{</* slide template="hotpink" */>}}
# I'm a hot pink slide!
```
---
If a template exists in multiple configurations, it's properties will be merged. If a property is declared multiple times, the order of precedence is:
- page
- section (_index.md)
- site (config.toml)
{{% /section %}}
---
{{% section %}}
{{< slide content="home.reusable" >}}
---
{{< slide content="common.nested.reusable" >}}
{{% /section %}}
---
{{% section %}}
## Slide-specific CSS
Add more variety to your presentation by applying slide-specific CSS.
<br>
<small>
navigate down to learn more
</small>
<br>
<a href="#" class="navigate-down">🔽</a>
---
First, use the `slide` shortcode to give the slide a class:
```markdown
---
{{</* slide class="side-by-side" */>}}
# 📈
# 📊
---
```
---
Next, use a layout extension partial like `reveal-hugo/head.html` to add CSS selectors:
```html
<style>
.reveal section.side-by-side h1 {
position: absolute;
}
.reveal section.side-by-side h1:first-of-type {
left: 25%;
}
.reveal section.side-by-side h1:nth-of-type(2) {
right: 25%;
}
</style>
```
---
{{< slide class="side-by-side" >}}
# 📈
# 📊
{{% /section %}}
|