themen-hugo-35c3-reveal/README.md

73 lines
2.7 KiB
Markdown
Raw Normal View History

2018-04-26 17:25:43 -05:00
# reveal-hugo
2018-04-27 00:37:10 -05:00
A Hugo theme for creating [Reveal.js](https://revealjs.com/) presentations that allows you to put multiple slides in the same markdown file. It also allows you to create multiple presentations in the same project.
2018-04-26 17:25:43 -05:00
![screenshot of reveal-hugo](/images/reveal-hugo.png)
2018-04-26 18:12:22 -05:00
The motivation behind creating this theme is pretty simple - I didn't want to have to manage one markdown file for every slide, which would add the overhead of coming up with a file name, setting a `weight` param in the front matter to keep it in order, etc, all for just a few lines of text. Instead, I like to organize groups of slides into a smaller number of markdown files, each representing a section of the presentation.
### Example
2018-04-27 00:37:10 -05:00
Using reveal-hugo, a three-slide (or n-slide) presentation can be created with just one markdown file, like so:
2018-04-26 18:12:22 -05:00
```markdown
# English
Hello.
---
# Français
Salu.
---
# Espagñol
Hola.
```
The only requirement is to demarcate slides with `---` surrounded by newlines.
# Demo
2018-04-27 01:11:35 -05:00
Visit [https://dzello.com/reveal-hugo/](https://dzello.com/reveal-hugo/) to see an presentation created with this theme that shows more ways to use it. You can also check out this repository [running on Netlify](https://reveal-hugo.netlify.com/).
2018-04-26 18:12:22 -05:00
# Usage
2018-04-27 00:37:10 -05:00
To create the default presentation (the one that will live at the site root), the theme will look for a `content/_index.md` file and any pages that have a type of `home`. That means they're in a `home` directory in the `content` folder OR the type is manually set to `home` in the front matter.
2018-04-26 18:12:22 -05:00
```toml
2018-04-27 00:37:10 -05:00
type = 'home'
2018-04-26 18:12:22 -05:00
```
Use the `weight` param in the front matter to specify the order that the pages should appear in the presentation.
```toml
weight = 20
```
2018-04-26 18:43:52 -05:00
### Section presentations
2018-04-27 00:37:10 -05:00
To create more presentations in the same repository, place the content into sections. Section presentations will include content from each file in that section including an `_index.md` file if it exists. Again, use the `weight` param to order the sections (`_index.md` will always be first).
2018-04-26 18:43:52 -05:00
2018-04-27 00:50:08 -05:00
Section presentations can use a different Reveal.js theme by specifying the `reveal_theme` parameter in the front matter of the section's `_index.md` file.
```toml
reveal_theme = "noir"
```
2018-04-26 18:12:22 -05:00
### Fragments
Fragments are a Reveal.js concept that lets you introduce content into each slide incrementally. Borrowing the concept from [hugo-theme-revealjs](https://github.com/RealOrangeOne/hugo-theme-revealjs), you can use a `fragment` shortcode to accomplish this in reveal-hugo in the same way.
```markdown
# Let's count to three...
{{% fragment %}} One {{% /fragment %}}
{{% fragment %}} Two {{% /fragment %}}
{{% fragment %}} Three {{% /fragment %}}
```
# Configuration
- `params.reveal_theme`: The Reveal.js theme used, defaults to "black"