From ad823cc4d72edbab10f0dadf99b30df91c3f7c50 Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Sun, 16 Aug 2020 08:38:04 +0300 Subject: Squashed 'website/themes/reveal-hugo/' content from commit ff9f389 git-subtree-dir: website/themes/reveal-hugo git-subtree-split: ff9f389743ae2fe5c5cc6101455db0616e8548e2 --- exampleSite/content/logo-example/_index.md | 103 +++++++++++++++++++++++ exampleSite/content/logo-example/github-logo.png | Bin 0 -> 87766 bytes 2 files changed, 103 insertions(+) create mode 100644 exampleSite/content/logo-example/_index.md create mode 100644 exampleSite/content/logo-example/github-logo.png (limited to 'exampleSite/content/logo-example') diff --git a/exampleSite/content/logo-example/_index.md b/exampleSite/content/logo-example/_index.md new file mode 100644 index 0000000..d943296 --- /dev/null +++ b/exampleSite/content/logo-example/_index.md @@ -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 `` tag +- body.html: Add markup just before the closing `` 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 + +``` + +--- + +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 + +``` + + +💡 Depending on the theme you're using, your styles will be different.
You may also prefer to put your CSS in an external file or your Reveal.js theme. +
+ +--- + +# 🤗 + +That's it. + +Happy Hugo-ing! \ No newline at end of file diff --git a/exampleSite/content/logo-example/github-logo.png b/exampleSite/content/logo-example/github-logo.png new file mode 100644 index 0000000..9a6e56c Binary files /dev/null and b/exampleSite/content/logo-example/github-logo.png differ -- cgit v1.3.1-23-gd82d