Document slide templates in the exampleSite presentation

This commit is contained in:
dzello 2018-07-23 00:44:05 +02:00
parent 8b76bd9182
commit 77d38e4f34
4 changed files with 51 additions and 2 deletions

View File

@ -11,6 +11,9 @@ name = "Josh Dzielak"
[params]
description = "Includes a handy markdown-based syntax and shortcodes to help you get presentations done fast"
[params.reveal_hugo]
history = true
[outputFormats.Reveal]
baseName = "index"
mediaType = "text/html"

View File

@ -4,11 +4,12 @@ description = "A Hugo theme for creating Reveal.js presentations"
outputs = ["Reveal"]
[reveal_hugo]
custom_theme = "reveal-hugo/themes/robot-lung.css"
history = true
margin = 0.2
highlight_theme = "color-brewer"
transition = "slide"
transition_speed = "fast"
[reveal_hugo.templates.hotpink]
background = "#FF4081"
+++
# 📽️

View File

@ -3,7 +3,6 @@ title = "Example of a section presentation"
outputs = ["Reveal"]
[reveal_hugo]
theme = "moon"
history = true
+++
# Section Presentation

View File

@ -81,6 +81,52 @@ Slide attribute possibilities from the [Reveal.js docs](https://github.com/hakim
{{% 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]
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!
{{%/* /slide */%}}
```
{{% /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.example" /%}}
{{% /section %}}