From e0c548e404fb46cbc6fee1c9ca31952eb40c383c Mon Sep 17 00:00:00 2001 From: dzello Date: Sat, 21 Jul 2018 10:55:03 +0200 Subject: [PATCH] Update exampleSite to show slide shortcode content attribute --- exampleSite/content/home/resources.md | 2 +- .../content/home/shortcodes/markdown.md | 8 ++-- exampleSite/content/home/shortcodes/other.md | 10 +++-- .../content/home/shortcodes/section.md | 11 ++++-- exampleSite/content/home/shortcodes/slide.md | 7 ++++ exampleSite/data/home.toml | 37 +++++++++++++++++++ 6 files changed, 64 insertions(+), 11 deletions(-) create mode 100644 exampleSite/data/home.toml diff --git a/exampleSite/content/home/resources.md b/exampleSite/content/home/resources.md index fe036dc..2a96f69 100644 --- a/exampleSite/content/home/resources.md +++ b/exampleSite/content/home/resources.md @@ -6,7 +6,7 @@ weight = 42 --- -## Get the code +## 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) diff --git a/exampleSite/content/home/shortcodes/markdown.md b/exampleSite/content/home/shortcodes/markdown.md index 802dc08..65ff013 100644 --- a/exampleSite/content/home/shortcodes/markdown.md +++ b/exampleSite/content/home/shortcodes/markdown.md @@ -6,21 +6,21 @@ weight = 36 ## Markdown -Markdown is not processed by Hugo but passed directly through to Reveal.js. +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. ``` {{}} + # Hello world! + {{}} ``` -[See the Reveal.js markdown docs](https://github.com/hakimel/reveal.js#markdown) - --- -Reveaj.js Markdown uses HTML comments to change slide properties, like background color. +Reveal.js markdown uses HTML comments to change slide properties, like background color. ``` {{}} diff --git a/exampleSite/content/home/shortcodes/other.md b/exampleSite/content/home/shortcodes/other.md index c262852..abc9d5a 100644 --- a/exampleSite/content/home/shortcodes/other.md +++ b/exampleSite/content/home/shortcodes/other.md @@ -4,23 +4,27 @@ weight = 38 ## Note -Add speaker notes to your presentation. +Add speaker notes to your presentation with the note shortcode. ```markdown {{%/* note */%}} + Type 's' to see this slide's speaker notes. + {{%/* /note */%}} ``` {{% note %}} + You found the speaker notes! + {{% /note %}} ---
-

Pure HTML Slide

-

Surround slides in a section tag with a data-noprocess attribute to write them in pure HTML.

+

Write slides in HTML

+

Use a section tag with a data-noprocess attribute to avoid any processing by reveal-hugo.

 <section data-noprocess>
   <h1>Hello world!</h1>
diff --git a/exampleSite/content/home/shortcodes/section.md b/exampleSite/content/home/shortcodes/section.md
index bd987fa..87eeba7 100644
--- a/exampleSite/content/home/shortcodes/section.md
+++ b/exampleSite/content/home/shortcodes/section.md
@@ -1,14 +1,19 @@
 +++
-weight = 36
+weight = 33
 +++
 
 {{% section %}}
 
 ## Section
 
-The `section` shortcode groups slides into a vertical display.
+The `section` shortcode groups slides into a **vertical display**.
 
-**To continue, use the down arrow or swipe down.**
+
+ +use the down arrow or swipe down to continue + +
+🔽 --- diff --git a/exampleSite/content/home/shortcodes/slide.md b/exampleSite/content/home/shortcodes/slide.md index b61e63d..3b3694f 100644 --- a/exampleSite/content/home/shortcodes/slide.md +++ b/exampleSite/content/home/shortcodes/slide.md @@ -40,3 +40,10 @@ Customize individual slide parameters like background color and transition. {{% /slide %}} +--- + +{{% section %}} + +{{< slide content="home.example" >}} + +{{% /section %}} diff --git a/exampleSite/data/home.toml b/exampleSite/data/home.toml new file mode 100644 index 0000000..1c6dd8f --- /dev/null +++ b/exampleSite/data/home.toml @@ -0,0 +1,37 @@ +example = ''' + +# Reusable slides + +Store markdown in a [data template](https://gohugo.io/templates/data-templates/) and reuse it in multiple sections or presentations. + +
+ +scroll down to learn more + +
+🔽 + +--- + +Add an `example` key to data/home.toml: + +``` +example = "I'm a slide" +``` +
+ +Set the `content` attribute to "home.example": + +``` +{{< slide content="home.example" >}} +``` + +--- + +💡 Each data template entry can contain one or more slides, separated by `---` with newlines. + +--- + +💡 All other slide shortcode attributes (background, transition, etc.) can be used and will be applied to each slide in the data template entry. + +'''