Initial commit
This commit is contained in:
22
themes/reveal-hugo/exampleSite/content/_index.md
Normal file
22
themes/reveal-hugo/exampleSite/content/_index.md
Normal file
@ -0,0 +1,22 @@
|
||||
+++
|
||||
title = "reveal-hugo"
|
||||
description = "A Hugo theme for creating Reveal.js presentations"
|
||||
outputs = ["Reveal"]
|
||||
[reveal_hugo]
|
||||
custom_theme = "reveal-hugo/themes/robot-lung.css"
|
||||
margin = 0.2
|
||||
highlight_theme = "color-brewer"
|
||||
transition = "slide"
|
||||
transition_speed = "fast"
|
||||
[reveal_hugo.templates.hotpink]
|
||||
class = "hotpink"
|
||||
background = "#FF4081"
|
||||
+++
|
||||
|
||||
# 📽️
|
||||
|
||||
# reveal-hugo
|
||||
|
||||
A Hugo theme for creating Reveal.js presentations.
|
||||
|
||||
~ made by [@dzello](https://dzello.com/) ~
|
@ -0,0 +1,16 @@
|
||||
+++
|
||||
+++
|
||||
|
||||
If more markdown files are present in the bundle, their contents will be added to the presentation.
|
||||
|
||||
---
|
||||
|
||||
Specify `weight` in the frontmatter if it's necessary to order them.
|
||||
|
||||
---
|
||||
|
||||
If you don't want them to be included, specify `layout = "list"` in the front matter instead of `layout = "bundle"`.
|
||||
|
||||
---
|
||||
|
||||
## THE END
|
@ -0,0 +1,30 @@
|
||||
+++
|
||||
title = "Bundle example presentation"
|
||||
outputs = ["Reveal"]
|
||||
layout = "bundle"
|
||||
[reveal_hugo]
|
||||
theme = "night"
|
||||
margin = 0.2
|
||||
+++
|
||||
|
||||
# Page Bundles
|
||||
|
||||
---
|
||||
|
||||
[Hugo page bundles](https://gohugo.io/content-management/page-bundles/) are a useful way to organize content.
|
||||
|
||||
---
|
||||
|
||||
To create a reveal-hugo presentation from the `index.md` file of a leaf page bundle, you need to specify the layout manually.
|
||||
|
||||
```toml
|
||||
layout = "bundle"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
Why? By default, reveal-hugo doesn't create pages for single template types (foo.md), only for list template types (_index.md).
|
||||
|
||||
---
|
||||
|
||||
This technique can also be used to output an HTML file for any section of a presentation, should you need to.
|
@ -0,0 +1,74 @@
|
||||
+++
|
||||
title = "Custom theme example presentation"
|
||||
outputs = ["Reveal"]
|
||||
[reveal_hugo]
|
||||
custom_theme = "custom-theme.scss"
|
||||
custom_theme_compile = true
|
||||
+++
|
||||
|
||||
## 🖌 ️
|
||||
|
||||
## Custom Themes
|
||||
|
||||
*with Hugo Pipes*
|
||||
|
||||
---
|
||||
|
||||
This presentation uses a custom Reveal.js theme written in SCSS that is compiled by Hugo, using [Hugo pipes](https://gohugo.io/hugo-pipes/).
|
||||
|
||||
---
|
||||
|
||||
Hugo pipes compiles the source code of the theme, located in `assets/custom-theme.scss`, into CSS.
|
||||
|
||||
---
|
||||
|
||||
## 😄
|
||||
|
||||
No separate build process is required, which means you can iterate on your theme and your content at the same time.
|
||||
|
||||
---
|
||||
|
||||
To set a custom theme and use Hugo to compile it:
|
||||
|
||||
```toml
|
||||
[reveal_hugo]
|
||||
custom_theme = "custom-theme.scss"
|
||||
custom_theme_compile = true
|
||||
```
|
||||
|
||||
`custom-theme.scss` must live in the `assets` folder.
|
||||
|
||||
---
|
||||
|
||||
To pass compilation options, use the `custom_theme_options` param:
|
||||
|
||||
```toml
|
||||
[reveal_hugo.custom_theme_options]
|
||||
targetPath = "css/custom-theme.css"
|
||||
enableSourceMap = true
|
||||
```
|
||||
|
||||
See all the [available options](https://gohugo.io/hugo-pipes/scss-sass/#options).
|
||||
|
||||
---
|
||||
|
||||
Note: to use a custom theme that doesn't need compilation, put it in the `static` directory and do not set the `custom_theme_compile` parameter. It will be served to the browser directly.
|
||||
|
||||
---
|
||||
|
||||
Write a custom Reveal.js theme in four steps:
|
||||
|
||||
```text
|
||||
1. Import `mixins` and `settings` from the templates directory
|
||||
2. Override variables and functions for colors, fonts and sizes
|
||||
3. Import `theme` from the templates directory
|
||||
4. Add any additional selectors to override the built CSS
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
See the [Reveal.js theme docs](https://github.com/hakimel/reveal.js/blob/master/css/theme/README.md) to learn what overrides are possible.
|
||||
|
||||
---
|
||||
|
||||
See `assets/custom-theme.scss` or any file in `assets/reveal-js/css/theme/source` for an example.
|
@ -0,0 +1,53 @@
|
||||
+++
|
||||
title = "Extend layout with configuration"
|
||||
outputs = ["Reveal"]
|
||||
[reveal_hugo]
|
||||
theme = "night"
|
||||
margin = 0.2
|
||||
custom_css = "css/custom.css"
|
||||
custom_js = "js/custom.js"
|
||||
+++
|
||||
|
||||
### Extending an existing layout
|
||||
|
||||
If you are using an existing theme and you want to a specific CSS class or add a dynamic function using javascript. It is possible to extend existing layout.
|
||||
|
||||
---
|
||||
|
||||
### Extending CSS
|
||||
|
||||
You can use `partials` or you can specify `custom_css` in your configuration :
|
||||
|
||||
```toml
|
||||
[reveal_hugo]
|
||||
custom_css = "css/custom.css"
|
||||
```
|
||||
<small>
|
||||
The `custom.css` can be present in `static/css/custom.css`
|
||||
</small>
|
||||
|
||||
---
|
||||
|
||||
### Extending with javascript
|
||||
|
||||
Same as CSS you can extend your presentation with javascript using `partials` or with `custom_js` in your configuration:
|
||||
|
||||
```toml
|
||||
[reveal_hugo]
|
||||
custom_js = "js/custom.js"
|
||||
```
|
||||
|
||||
<small>
|
||||
The `custom.js` can be present in `static/js/custom.js`
|
||||
</small>
|
||||
|
||||
---
|
||||
|
||||
{{< slide class="custom" id="customjs" >}}
|
||||
## Extend layout example
|
||||
Here the slide has an additional css class `custom` using `slide` *shortcode*. This class is hosted in a custom CSS.
|
||||
|
||||
If you click on this text background-color will using a custom javascript file.
|
||||
|
||||
|
||||
|
@ -0,0 +1,160 @@
|
||||
+++
|
||||
title = "Reveal.js 3.9.0 highlighting example"
|
||||
outputs = ["Reveal"]
|
||||
|
||||
[reveal_hugo]
|
||||
theme = "white"
|
||||
highlight_theme = "vs"
|
||||
+++
|
||||
|
||||
## Multiline highlighting with Highlight.js
|
||||
|
||||
---
|
||||
|
||||
This presentation shows the use of the [new highlighting features](https://github.com/hakimel/reveal.js/blob/master/README.md#step-by-step-highlights) which were introduced with Reveal.js [v3.9.0](https://github.com/hakimel/reveal.js/releases/tag/3.9.0).
|
||||
|
||||
---
|
||||
|
||||
## Prerequisite
|
||||
|
||||
Disable `codeFences` in to your `config.toml` to prevent Hugo's built-in highlighting for code inside of `---` fences.
|
||||
|
||||
{{< highlight toml "style=github" >}}
|
||||
[markup.highlight]
|
||||
codeFences = false
|
||||
{{< /highlight >}}
|
||||
|
||||
---
|
||||
|
||||
## Theme
|
||||
|
||||
Specify a theme for Highlight.js in `config.toml`
|
||||
|
||||
{{< highlight toml "style=github" >}}
|
||||
[params.reveal_hugo]
|
||||
highlight_theme = "github"
|
||||
{{< /highlight >}}
|
||||
|
||||
---
|
||||
|
||||
...or in the `_index.md` front matter
|
||||
|
||||
{{< highlight toml "style=github" >}}
|
||||
[reveal_hugo]
|
||||
highlight_theme = "github"
|
||||
{{< /highlight >}}
|
||||
|
||||
---
|
||||
|
||||
## Usage
|
||||
|
||||
The line highlighting is configured by adding `{}` immediately after the language selection of the markdown code block.
|
||||
|
||||
{{< highlight md >}}
|
||||
```foo{}
|
||||
|
||||
```
|
||||
{{< /highlight >}}
|
||||
|
||||
---
|
||||
|
||||
## Just line numbers
|
||||
|
||||
`{}`
|
||||
|
||||
{{< highlight md >}}
|
||||
```go{}
|
||||
package main
|
||||
import "fmt"
|
||||
func main() {
|
||||
fmt.Println("Hello world!")
|
||||
}
|
||||
```
|
||||
{{< /highlight >}}
|
||||
|
||||
```go{}
|
||||
package main
|
||||
import "fmt"
|
||||
func main() {
|
||||
fmt.Println("Hello world!")
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Highlight specific lines
|
||||
|
||||
`{<line numbers separated by comma>}`
|
||||
|
||||
{{< highlight md >}}
|
||||
```go{1,3-5}
|
||||
package main
|
||||
import "fmt"
|
||||
func main() {
|
||||
fmt.Println("Hello world!")
|
||||
}
|
||||
```
|
||||
{{< /highlight >}}
|
||||
```go{1,3-5}
|
||||
package main
|
||||
import "fmt"
|
||||
func main() {
|
||||
fmt.Println("Hello world!")
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Multi step highlight
|
||||
|
||||
`{<line numbers separated by pipe>}`
|
||||
|
||||
{{< highlight md >}}
|
||||
```go{1|2|3-5}
|
||||
package main
|
||||
import "fmt"
|
||||
func main() {
|
||||
fmt.Println("Hello world!")
|
||||
}
|
||||
```
|
||||
{{< /highlight >}}
|
||||
|
||||
```go{1|2|3-5}
|
||||
package main
|
||||
import "fmt"
|
||||
func main() {
|
||||
fmt.Println("Hello world!")
|
||||
}
|
||||
```
|
||||
---
|
||||
|
||||
## Hiding the line numbers
|
||||
|
||||
There is no Reveal.js parameter to use line highlighting *without* line numbers.
|
||||
However it can be achieved by adding the some [custom CSS](https://github.com/dzello/reveal-hugo#adding-html-to-the-layout).
|
||||
|
||||
{{< highlight html "style=github" >}}
|
||||
<style>
|
||||
.hljs-ln-numbers {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
{{< /highlight >}}
|
||||
|
||||
---
|
||||
|
||||
💡 Put the custom CSS in either of these partials:
|
||||
|
||||
```text
|
||||
# for all presentations
|
||||
layouts/partials/reveal-hugo/body.html
|
||||
```
|
||||
|
||||
```text
|
||||
# for one presentation
|
||||
layouts/partials/{presentation-name}/reveal-hugo/body.html
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
Thanks!
|
170
themes/reveal-hugo/exampleSite/content/home/configuration.md
Normal file
170
themes/reveal-hugo/exampleSite/content/home/configuration.md
Normal file
@ -0,0 +1,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 </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 |
|
||||
|
||||
|
||||
|
||||
<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>
|
25
themes/reveal-hugo/exampleSite/content/home/features.md
Normal file
25
themes/reveal-hugo/exampleSite/content/home/features.md
Normal file
@ -0,0 +1,25 @@
|
||||
+++
|
||||
weight = 10
|
||||
+++
|
||||
|
||||
## What's included?
|
||||
|
||||
- All Reveal.js HTML, CSS and JS (v3.9.2)
|
||||
- All out-of-the-box Reveal.js themes
|
||||
- Two custom Reveal.js themes (including this one)
|
||||
|
||||
<br>
|
||||
<br>
|
||||
|
||||
[see the code on github](https://github.com/dzello/reveal-hugo)
|
||||
|
||||
---
|
||||
|
||||
## Features
|
||||
|
||||
- Write slides in Markdown in one or more files
|
||||
- Shortcodes for fragments, sections, slides & more
|
||||
- All Reveal.js parameters can be customized
|
||||
- Any Hugo section can be output as a presentation
|
||||
- Supports offline development or using a CDN
|
||||
|
43
themes/reveal-hugo/exampleSite/content/home/resources.md
Normal file
43
themes/reveal-hugo/exampleSite/content/home/resources.md
Normal file
@ -0,0 +1,43 @@
|
||||
+++
|
||||
weight = 42
|
||||
+++
|
||||
|
||||
# Resources
|
||||
|
||||
---
|
||||
|
||||
## Code and docs
|
||||
|
||||
- [reveal-hugo Github README](https://github.com/dzello/reveal-hugo)
|
||||
- [Content for this presentation](https://github.com/dzello/reveal-hugo/tree/master/exampleSite)
|
||||
|
||||
---
|
||||
|
||||
## External resources
|
||||
|
||||
- [Reveal.js](https://revealjs.com/)
|
||||
- [Hugo docs](https://gohugo.io/)
|
||||
- [Hugo output format docs](https://gohugo.io/templates/output-formats/)
|
||||
|
||||
---
|
||||
|
||||
## Designed to...
|
||||
|
||||
- Deploy to [Netlify](https://netlify.com/)
|
||||
- Edit with [Forestry](https://forestry.io/)
|
||||
|
||||
---
|
||||
|
||||
# 🙏
|
||||
|
||||
Contribute by opening issues and pull requests.
|
||||
|
||||
---
|
||||
|
||||
# Thanks!
|
||||
|
||||
---
|
||||
|
||||
# ↩️
|
||||
|
||||
#### [Start over](#)
|
@ -0,0 +1,41 @@
|
||||
+++
|
||||
weight = 30
|
||||
+++
|
||||
|
||||
## Fragment
|
||||
|
||||
The `fragment` shortcode makes content appear incrementally.
|
||||
|
||||
```
|
||||
{{%/* fragment */%}} One {{%/* /fragment */%}}
|
||||
{{%/* fragment */%}} Two {{%/* /fragment */%}}
|
||||
{{%/* fragment */%}} Three {{%/* /fragment */%}}
|
||||
```
|
||||
|
||||
{{% fragment %}} One {{% /fragment %}}
|
||||
{{% fragment %}} Two {{% /fragment %}}
|
||||
{{% fragment %}} Three {{% /fragment %}}
|
||||
|
||||
---
|
||||
|
||||
## Frag
|
||||
|
||||
The `frag` shortcode is more terse than `fragment`. It accepts a `c` attribute.
|
||||
|
||||
```
|
||||
{{</* frag c="One" */>}}
|
||||
{{</* frag c="Two" */>}}
|
||||
{{</* frag c="Three" */>}}
|
||||
```
|
||||
|
||||
{{< frag c="One" >}}
|
||||
{{< frag c="Two" >}}
|
||||
{{< frag c="Three" >}}
|
||||
|
||||
---
|
||||
|
||||
Both `fragment` and `frag` accept two additional parameters:
|
||||
|
||||
- `class`: sets the class of the wrapping `span` element
|
||||
- `index`: controls the order in which sections will appear
|
||||
|
@ -0,0 +1,11 @@
|
||||
+++
|
||||
weight = 29
|
||||
+++
|
||||
|
||||
# Shortcodes
|
||||
|
||||
---
|
||||
|
||||
Hugo's shortcodes are similar to functions or templates that extend what you can do with Markdown.
|
||||
|
||||
[Shortcode documentation](https://gohugo.io/content-management/shortcodes/)
|
@ -0,0 +1,38 @@
|
||||
+++
|
||||
weight = 36
|
||||
+++
|
||||
|
||||
{{< markdown >}}
|
||||
|
||||
## Markdown
|
||||
|
||||
Reveal.js has its own [markdown processor](https://github.com/hakimel/reveal.js#markdown). To use that instead of Hugo, surround a slide with the markdown shortcode.
|
||||
|
||||
```markdown
|
||||
{{</* markdown */>}}
|
||||
|
||||
# Hello world!
|
||||
|
||||
{{</* /markdown */>}}
|
||||
```
|
||||
|
||||
<br>
|
||||
<small>
|
||||
💡 Make sure to use the `{{</* */>}}` shortcode syntax to avoid rendering by Hugo.
|
||||
</small>
|
||||
|
||||
---
|
||||
|
||||
<!-- .slide: data-background="#FF4081" -->
|
||||
|
||||
Reveal.js markdown uses HTML comments to change slide properties, like background color.
|
||||
|
||||
```markdown
|
||||
{{</* markdown */>}}
|
||||
<!-- .slide: data-background="#FF4081" -->
|
||||
# I'm a colorful slide
|
||||
{{</* /markdown */>}}
|
||||
```
|
||||
|
||||
{{< /markdown >}}
|
||||
|
@ -0,0 +1,49 @@
|
||||
+++
|
||||
weight = 38
|
||||
+++
|
||||
|
||||
## Notes
|
||||
|
||||
Add speaker notes (with markdown) to your presentation with the `note` shortcode. Type 's' to see this slide's speaker notes.
|
||||
|
||||
```markdown
|
||||
---
|
||||
|
||||
{{%/* note */%}}
|
||||
- You found the **speaker notes**!
|
||||
{{%/* /note */%}}
|
||||
|
||||
---
|
||||
```
|
||||
|
||||
{{% note %}}
|
||||
- You found the **speaker notes**!
|
||||
{{% /note %}}
|
||||
|
||||
---
|
||||
|
||||
{{< slide notes="You found the notes!" >}}
|
||||
|
||||
## Notes
|
||||
|
||||
You can also add notes with the `slide` shortcode and `notes` attribute:
|
||||
|
||||
```markdown
|
||||
---
|
||||
|
||||
{{%/* slide notes="You found the notes!" */%}}
|
||||
|
||||
---
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
<section data-noprocess>
|
||||
<h2>Write slides in HTML</h2>
|
||||
<p>Use a <code>section</code> tag with a <code>data-noprocess</code> attribute to avoid any processing by reveal-hugo.</p>
|
||||
<pre>
|
||||
<section data-noprocess>
|
||||
<h1>Hello world!</h1>
|
||||
</section></pre>
|
||||
<small>💡 This is useful if you can't get Markdown to output exactly what you want.</small>
|
||||
</section>
|
@ -0,0 +1,44 @@
|
||||
+++
|
||||
weight = 33
|
||||
+++
|
||||
|
||||
{{% section %}}
|
||||
|
||||
## Section
|
||||
|
||||
The `section` shortcode groups slides into a **vertical display**.
|
||||
|
||||
<br>
|
||||
<small>
|
||||
use the down arrow or swipe down to continue
|
||||
</small>
|
||||
<br>
|
||||
<a href="#" class="navigate-down">🔽</a>
|
||||
|
||||
---
|
||||
|
||||
Put the shortcode around the slides you want to group together.
|
||||
|
||||
```markdown
|
||||
{{%/* section */%}}
|
||||
|
||||
## Section slide 1
|
||||
|
||||
---
|
||||
|
||||
## Section slide 2
|
||||
|
||||
{{%/* /section */%}}
|
||||
```
|
||||
|
||||
Keep going down.
|
||||
|
||||
---
|
||||
|
||||
## That's it!
|
||||
|
||||
Use the right arrow or swipe right to continue.
|
||||
|
||||
{{% /section %}}
|
||||
|
||||
|
250
themes/reveal-hugo/exampleSite/content/home/shortcodes/slide.md
Normal file
250
themes/reveal-hugo/exampleSite/content/home/shortcodes/slide.md
Normal file
@ -0,0 +1,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 %}}
|
109
themes/reveal-hugo/exampleSite/content/home/usage.md
Normal file
109
themes/reveal-hugo/exampleSite/content/home/usage.md
Normal file
@ -0,0 +1,109 @@
|
||||
+++
|
||||
weight = 20
|
||||
+++
|
||||
|
||||
# Usage
|
||||
|
||||
---
|
||||
|
||||
## Prerequisite
|
||||
|
||||
First, add this to your `config.toml`:
|
||||
|
||||
```toml
|
||||
[outputFormats.Reveal]
|
||||
baseName = "index"
|
||||
mediaType = "text/html"
|
||||
isHTML = true
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Presentation at site root
|
||||
|
||||
Create `content/_index.md`:
|
||||
|
||||
```markdown
|
||||
+++
|
||||
outputs = ["Reveal"]
|
||||
+++
|
||||
|
||||
# Slide 1
|
||||
|
||||
Hello world!
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Add slides
|
||||
|
||||
Separate them by `---` surrounded by blank lines:
|
||||
|
||||
```
|
||||
# Slide 1
|
||||
|
||||
Hello world!
|
||||
|
||||
---
|
||||
|
||||
# Slide 2
|
||||
|
||||
Hello program!
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Add slides with other files
|
||||
|
||||
Add slides to `content/home/*.md`
|
||||
|
||||
```markdown
|
||||
+++
|
||||
weight = 10
|
||||
+++
|
||||
|
||||
# Slide 3
|
||||
|
||||
---
|
||||
|
||||
# Slide 4
|
||||
```
|
||||
|
||||
<small>💡 Tip: Use `weight` to specify the order that files should be considered.</small>
|
||||
|
||||
---
|
||||
|
||||
### Presentation at '/{section}/'
|
||||
|
||||
Add slides to `content/{section}/_index.md`:
|
||||
|
||||
```markdown
|
||||
+++
|
||||
outputs = ["Reveal"]
|
||||
+++
|
||||
|
||||
# Slide 1
|
||||
|
||||
---
|
||||
|
||||
# Slide 2
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
Add slides from other files in `content/{section}/*.md`
|
||||
|
||||
```markdown
|
||||
+++
|
||||
weight = 10
|
||||
+++
|
||||
|
||||
# Slide 3
|
||||
|
||||
---
|
||||
|
||||
# Slide 4
|
||||
```
|
||||
|
||||
<small>💡 Tip: Use `weight` to specify the order that files should be considered.</small>
|
||||
|
113
themes/reveal-hugo/exampleSite/content/hugo-hl-example/_index.md
Normal file
113
themes/reveal-hugo/exampleSite/content/hugo-hl-example/_index.md
Normal file
@ -0,0 +1,113 @@
|
||||
+++
|
||||
title = "Hugo highlighting example"
|
||||
outputs = ["Reveal"]
|
||||
|
||||
[reveal_hugo]
|
||||
theme = "simple"
|
||||
+++
|
||||
|
||||
## Hugo Highlighter Presentation
|
||||
|
||||
This is an example of a presentation using Hugo's compile-time syntax highlighter.
|
||||
|
||||
---
|
||||
|
||||
Reveal.js uses Javascript for syntax highlighting (via Highlight.js). This might slow the presentation down if many slides contain code.
|
||||
|
||||
---
|
||||
|
||||
Hugo has a built-in [compile-time highlighter](https://gohugo.io/content-management/syntax-highlighting/), and it's lightning fast too!
|
||||
|
||||
---
|
||||
|
||||
You can enable it using the `highlight` shortcode.
|
||||
|
||||
{{< highlight go >}}
|
||||
{{</* highlight go */>}}
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Println("Hello world!")
|
||||
}
|
||||
|
||||
{{</* /highlight */>}}
|
||||
{{< /highlight >}}
|
||||
|
||||
---
|
||||
|
||||
Several options are supported, check [Hugo's documentation](https://gohugo.io/content-management/syntax-highlighting/).
|
||||
|
||||
{{< highlight go "style=github,linenos=inline,hl_lines=8" >}}
|
||||
{{</* highlight go "style=github,linenos=inline,hl_lines=6" */>}}
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Println("Hello world!")
|
||||
}
|
||||
|
||||
{{</* /highlight */>}}
|
||||
{{< / highlight >}}
|
||||
|
||||
---
|
||||
|
||||
You can also use Hugo's highlighter in markdown code fences,
|
||||
by putting this in `config.toml`:
|
||||
|
||||
{{< highlight toml "style=github" >}}
|
||||
|
||||
# use Hugo's hl in markdown (with or without a language tag)
|
||||
[markup.highlight]
|
||||
codeFences = true
|
||||
style = "github"
|
||||
|
||||
{{< /highlight >}}
|
||||
|
||||
(This can only be enabled globally for all presentations.)
|
||||
|
||||
---
|
||||
|
||||
- Highlight.js is automatically disabled in code blocks highlighted by Hugo.
|
||||
- The two highlighters can be even mixed.
|
||||
|
||||
{{< highlight go >}}
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Println("Hello world!")
|
||||
}
|
||||
{{< / highlight >}}
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Println("Hello world!")
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
If you don't need highlight.js at all, you can prevent it from loading.
|
||||
|
||||
{{< highlight toml "style=github" >}}
|
||||
|
||||
# This works both in config.toml and a presentation's front
|
||||
# matter. Default plugins include highlight.js, so disable them
|
||||
# and load those that we want manually.
|
||||
|
||||
[params.reveal_hugo]
|
||||
load_default_plugins = false
|
||||
plugins = [
|
||||
"reveal-js/plugin/zoom-js/zoom.js",
|
||||
"reveal-js/plugin/notes/notes.js",
|
||||
]
|
103
themes/reveal-hugo/exampleSite/content/logo-example/_index.md
Normal file
103
themes/reveal-hugo/exampleSite/content/logo-example/_index.md
Normal file
@ -0,0 +1,103 @@
|
||||
+++
|
||||
title = "Logo presentation example"
|
||||
outputs = ["Reveal"]
|
||||
[logo]
|
||||
src = "github-logo.png"
|
||||
alt = "GitHub logo with Octocat"
|
||||
[reveal_hugo]
|
||||
custom_theme = "reveal-hugo/themes/robot-lung.css"
|
||||
margin = 0.2
|
||||
+++
|
||||
|
||||
## logo-example
|
||||
|
||||
This presentation shows how to add a logo to each slide, like the GitHub one you see above.
|
||||
|
||||
You can generalize the concept to add any additional markup to your presentations.
|
||||
|
||||
---
|
||||
|
||||
[See the code for this presentation](https://github.com/dzello/reveal-hugo/blob/master/exampleSite/content/logo-example/_index.md)
|
||||
|
||||
---
|
||||
|
||||
First, create a partial called `body.html` and put it in this directory:
|
||||
|
||||
```text
|
||||
layouts/partials/{section}/reveal-hugo/body.html
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
Substitute `{section}` for `home` if you are adding a logo to the presentation at `content/_index.md`. Otherwise, substitute the name of the Hugo section where your presentation lives.
|
||||
|
||||
---
|
||||
|
||||
The presentation you're looking at right now is in `content/logo-example`, so the partial to add the logo lives in:
|
||||
|
||||
```text
|
||||
layouts/partials/logo-example/reveal-hugo/body.html
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
💡 Tip: to make the logo appear in every presentation, put it here:
|
||||
|
||||
```text
|
||||
layouts/partials/reveal-hugo/body.html
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
💡 Tip: In addition to `body.html`, you can create partials `head.html` and `end.html` in any of those directories.
|
||||
|
||||
---
|
||||
|
||||
- head.html: Add markup just before the closing `</head>` tag
|
||||
- body.html: Add markup just before the closing `</body>` tag
|
||||
- end.html: Add markup just before the closing of the Reveal.js `div.slides` container
|
||||
|
||||
---
|
||||
|
||||
Once the partial exists in `body.html`, we can add our image tag to it:
|
||||
|
||||
```html
|
||||
<img id="logo" src="{{ .Param "logo.src" }}" alt="{{ .Param "logo.alt" }}">
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
In this example, the src and alt attributes are set to values from the content's front matter or site's configuration, which you can see in `logo-example/_index.md`:
|
||||
|
||||
```toml
|
||||
[logo]
|
||||
src = "/images/github-logo.png"
|
||||
alt = "GitHub logo with Octocat"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
To position the logo, we can add a style tag to `body.html`:
|
||||
|
||||
```html
|
||||
<style>
|
||||
#logo {
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
left: 20px;
|
||||
width: 250px;
|
||||
}
|
||||
</style>
|
||||
```
|
||||
|
||||
<small>
|
||||
💡 Depending on the theme you're using, your styles will be different. <br>You may also prefer to put your CSS in an external file or your Reveal.js theme.
|
||||
</small>
|
||||
|
||||
---
|
||||
|
||||
# 🤗
|
||||
|
||||
That's it.
|
||||
|
||||
Happy Hugo-ing!
|
Binary file not shown.
After Width: | Height: | Size: 86 KiB |
@ -0,0 +1,83 @@
|
||||
+++
|
||||
title = "plugin-example"
|
||||
description = "Shows how a Reveal.js plugin can be added and used"
|
||||
outputs = ["Reveal"]
|
||||
[reveal_hugo]
|
||||
theme = "night"
|
||||
margin = 0.2
|
||||
plugins = ["plugin/gallery/gallery.plugin.js"]
|
||||
+++
|
||||
|
||||
# plugin-example
|
||||
|
||||
---
|
||||
|
||||
This presentation demonstrates how a Reveal.js plugin can be added.
|
||||
|
||||
---
|
||||
|
||||
The plugin is called [revealjs-simple-gallery](https://github.com/marcins/revealjs-simple-gallery).
|
||||
|
||||
---
|
||||
|
||||
It can make any slide an image gallery. Here are a few examples.
|
||||
|
||||
---
|
||||
|
||||
<ul class="gallery">
|
||||
<li><img src="sample1.jpg" alt="Default settings (Photo by Oscar Fernandez Alonso on Flickr)"></li>
|
||||
<li><img src="sample2.jpg" alt="Default settings (Photo by bullcitydogs on Flickr)"></li>
|
||||
<li><img src="sample3.jpg" alt="Default settings (Photo by Lance McCord on Flickr)"></li>
|
||||
</ul>
|
||||
|
||||
---
|
||||
|
||||
<ul class="gallery" data-iterations="0" data-interval="1">
|
||||
<li><img src="sample1.jpg" alt="Infinite iterations, fast transition (Photo by Oscar Fernandez Alonso on Flickr)"></li>
|
||||
<li><img src="sample2.jpg" alt="Infinite iterations, fast transition (Photo by bullcitydogs on Flickr)"></li>
|
||||
<li><img src="sample3.jpg" alt="Infinite iterations, fast transition (Photo by Lance McCord on Flickr)"></li>
|
||||
</ul>
|
||||
|
||||
---
|
||||
|
||||
<ul class="gallery" data-iterations="2" data-interval="2" data-mode="full-screen">
|
||||
<li><img src="sample1.jpg" alt="Full screen, two iterations, slow transition (Photo by Oscar Fernandez Alonso on Flickr)"></li>
|
||||
<li><img src="sample2.jpg" alt="Full screen, two iterations, slow transition (Photo by bullcitydogs on Flickr)"></li>
|
||||
<li><img src="sample3.jpg" alt="Full screen, two iterations, slow transition (Photo by Lance McCord on Flickr)"></li>
|
||||
</ul>
|
||||
|
||||
---
|
||||
|
||||
See the [revealjs-simple-gallery GitHub repo](https://github.com/marcins/revealjs-simple-gallery) to learn about more customization options.
|
||||
|
||||
---
|
||||
|
||||
These were the steps to use this plugin for this reveal-hugo presentation.
|
||||
|
||||
---
|
||||
|
||||
### 1
|
||||
|
||||
Copy the plugin CSS and JavaScript into the static directory
|
||||
|
||||
---
|
||||
|
||||
### 2
|
||||
|
||||
Add the JavaScript file path to the `plugins` field in the front matter
|
||||
|
||||
---
|
||||
|
||||
### 3
|
||||
|
||||
Create a `head.html` partial inside of `layouts/partials/plugin-example/reveal-hugo`
|
||||
|
||||
---
|
||||
|
||||
### 4
|
||||
|
||||
In `head.html`, add a stylesheet link tag that loads the plugin CSS
|
||||
|
||||
---
|
||||
|
||||
## THE END
|
Binary file not shown.
After Width: | Height: | Size: 316 KiB |
Binary file not shown.
After Width: | Height: | Size: 182 KiB |
Binary file not shown.
After Width: | Height: | Size: 173 KiB |
@ -0,0 +1,19 @@
|
||||
+++
|
||||
title = "Section presentation example"
|
||||
outputs = ["Reveal"]
|
||||
[reveal_hugo]
|
||||
theme = "night"
|
||||
margin = 0.2
|
||||
+++
|
||||
|
||||
# Section Presentation
|
||||
|
||||
This is an example of a section presentation.
|
||||
|
||||
---
|
||||
|
||||
Section presentations are completely separate from the root presentation and each other.
|
||||
|
||||
---
|
||||
|
||||
Additional content files can be placed in the section and will be added to the presentation in the order of their weight.
|
@ -0,0 +1,8 @@
|
||||
+++
|
||||
weight = 10
|
||||
+++
|
||||
|
||||
# Including...
|
||||
|
||||
Content from files like this one.
|
||||
|
@ -0,0 +1,45 @@
|
||||
+++
|
||||
title = "Template presentation"
|
||||
outputs = ["Reveal"]
|
||||
[reveal_hugo]
|
||||
theme = "night"
|
||||
margin = 0.2
|
||||
[reveal_hugo.templates.blue]
|
||||
background = "#0011DD"
|
||||
transition = "zoom"
|
||||
+++
|
||||
|
||||
## Template Example
|
||||
|
||||
---
|
||||
|
||||
This presentation shows how to take advantage of reveal-hugo's slide template feature.
|
||||
|
||||
---
|
||||
|
||||
Slide templates let you specify groups of slide attributes in one place and reuse them throughout the presentation.
|
||||
|
||||
---
|
||||
|
||||
{{< slide template="blue" >}}
|
||||
|
||||
Here's an example of using a template called `blue`, defined in the front matter of this presentation's `_index.md` file.
|
||||
|
||||
---
|
||||
|
||||
The template can contain any valid slide customization params:
|
||||
|
||||
```toml
|
||||
[reveal_hugo.templates.blue]
|
||||
background = "#0011DD"
|
||||
transition = "zoom"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
Then add it to any slide using the slide shortcode:
|
||||
|
||||
```
|
||||
{{</* slide template="blue" */>}}
|
||||
```
|
||||
|
@ -0,0 +1,16 @@
|
||||
+++
|
||||
+++
|
||||
|
||||
{{< slide template="grey" >}}
|
||||
|
||||
Templates can be specified in `config.toml` as well, for reusability across multiple presentations.
|
||||
|
||||
```
|
||||
[params.reveal_hugo.templates.grey]
|
||||
background = "#424242"
|
||||
transition = "convex"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## THE END
|
Reference in New Issue
Block a user