From bbbd59ad74436e0629f9aac8e68b2b621eac0166 Mon Sep 17 00:00:00 2001 From: dzello Date: Mon, 25 Mar 2019 02:26:48 +0100 Subject: [PATCH] Add example presentation for using slide templates; investigating #26 --- exampleSite/config.toml | 11 +++-- .../content/template-example/_index.md | 45 +++++++++++++++++++ .../content/template-example/continued.md | 16 +++++++ 3 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 exampleSite/content/template-example/_index.md create mode 100644 exampleSite/content/template-example/continued.md diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 3c6f1c0..d851934 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -8,10 +8,15 @@ themesDir = "../" [author] name = "Josh Dzielak" -[params.reveal_hugo] -history = true - [outputFormats.Reveal] baseName = "index" mediaType = "text/html" isHTML = true + +[params.reveal_hugo] +history = true + +# used in content/template-example +[params.reveal_hugo.templates.grey] +background = "#424242" +transition = "convex" \ No newline at end of file diff --git a/exampleSite/content/template-example/_index.md b/exampleSite/content/template-example/_index.md new file mode 100644 index 0000000..5b1ec68 --- /dev/null +++ b/exampleSite/content/template-example/_index.md @@ -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: + +``` +{{}} +``` + diff --git a/exampleSite/content/template-example/continued.md b/exampleSite/content/template-example/continued.md new file mode 100644 index 0000000..85ac367 --- /dev/null +++ b/exampleSite/content/template-example/continued.md @@ -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 \ No newline at end of file