Giter Site home page Giter Site logo

dzello / reveal-hugo Goto Github PK

View Code? Open in Web Editor NEW
647.0 12.0 143.0 7.29 MB

πŸ“½οΈ Create rich HTML-based presentations with Hugo and Reveal.js

Home Page: https://reveal-hugo.dzello.com/

License: MIT License

HTML 34.20% JavaScript 46.60% CSS 18.60% SCSS 0.60%
hugo reveal-js theme presentation slides

reveal-hugo's Introduction

reveal-hugo

License badge CircleCI Website up/down badge Last commit badge Netlify Status

A Hugo theme for Reveal.js that makes authoring and customization a breeze. With it, you can turn any properly-formatted Hugo content into a HTML presentation.

screenshot of reveal-hugo

⚠️ The latest version of this theme requires hugo version >= v0.93.0. If you need compatibility with an earlier version, try a previous release.

Example

Using reveal-hugo, presentations with multiple slides can be created with just one markdown file, like so:

+++
title = "How to say hello"
+++

# English
Hello.

---

# Français
Salut.

---

# EspaΓ±ol
Hola.

Just use --- surrounded by blank lines to split content into different slides.

Documentation

Visit reveal-hugo.dzello.com to see a presentation created with this theme and learn about all of the different functionality available to you.

For a full-length blog post about reveal-hugo, checkout Harness the Power of Static Site Generators to Create Presentations on the Forestry.io blog.

Demos

Jump to the exampleSite folder in this repository to see the source code for the above presentation and several more. Here are links to those presentations live:

  • logo-example - Shows how to add a logo to your presentation
  • custom-theme-example - Uses Hugo pipes to compile and use a custom Reveal.js SCSS theme (recommended!)
  • section-example - Very basic example that shows how to create a presentation for a Hugo section
  • plugin-example - Shows how to add additional Reveal.js plugins to your presentation, for example an image gallery
  • template-example - An example of using the slide shortcode with powerful templates
  • bundle-example - An example of creating a presentation from one or more markdown files in a leaf bundle
  • hugo-hl-example - An example of using Hugo's compile-time syntax highlighter
  • highlightjs-linenumbers-example - An example of using the multiline and multi-step capabilities of highlight.js
  • blank Reveal-Hugo template - A templated skeleton site to get started quickly

Starter repository

If you want to start creating a presentation right away, clone the programming-quotes repository and start hacking.

Tutorial: Create your first presentation

You should be able to complete this section with no prior knowledge of Hugo or Reveal.js. At the end, you'll have a working presentation with instant reloading.

Create a hugo skeleton site

To start, install Hugo and create a new Hugo site:

hugo new site my-presentation

Change into the directory of the new site:

cd my-presentation

Initialize a git repository:

git init

Get the reveal-hugo theme

Method 1 (recommended): use theme as hugo module

Turn your new skeleton site into a hugo module by issuing this command from site root:

hugo mod init github.com/me/my-presentation
  • Declare the reveal-hugo theme module as a dependency of your site:
hugo mod get github.com/dzello/reveal-hugo

Open hugo.toml and add the following line:

theme = ["github.com/dzello/reveal-hugo"]

Method 2 (traditional): use theme as git submodule

Add the reveal-hugo theme as a submodule in the themes directory:

git submodule add [email protected]:dzello/reveal-hugo.git themes/reveal-hugo

Open hugo.toml and add the following line:

theme = ["reveal-hugo"]

Configure your presentation

Add some more contents to your hugo.toml:

[markup.goldmark.renderer]
unsafe = true

[outputFormats.Reveal]
baseName = "index"
mediaType = "text/html"
isHTML = true

This tells Hugo to use the reveal-hugo theme and it registers a new output format called "Reveal".

Next, create a file in content/_index.md and add the following:

+++
title = "My presentation"
outputs = ["Reveal"]
+++

# Hello world!

This is my first slide.

Back on the command line, run:

$ hugo server

Navigate to http://localhost:1313/ and you should see your presentation.

New site with reveal-hugo

To add more slides, just add content to _index.md or create new markdown files in content/home. Remember that each slide must be separated by --- with blank lines above and below.

# Hello world!

This is my first slide.

---

# Hello Mars!

This is my second slide.

Cloning an existing repository (method 2 only)

If you have an existing repository that was setup with the above steps, you have to pull in the theme submodule after cloning your repository using the following command:

git submodule update --init

Theme update (method 1 only)

When making use of reveal-hugo theme as hugo module, updating your theme is really easy:

At the command prompt, change to the root directory of your existing site.

cd /path/to/my-presentation

Then invoke hugo's module get subcommand with the update flag -u:

hugo mod get -u github.com/dzello/reveal-hugo

Hugo will automatically pull in the latest theme version. That's it, your update is done!

Usage

The Usage guide is contained in the example presentation that lives in this repository in the exampleSite directory. You can access a live version at reveal-hugo.dzello.com.

Root vs. section presentations

Here's what the folder structure would look like with one root presentation and one section presentation.

- content
  - home # special section for appending to root presentation
    - body.md # appends to the root presentation
    - conclusion.md # appends to the root presentation
  - _index.md # beginning of the root presentation
  - ted-talk
    - _index.md # beginning of the ted talk presentation
    - body.md # appends to the ted talk presentation
    - conclusion.md # appends to the ted talk presentation

This will create two presentations, one at / and one at /ted-talk/. The order that slides are appended to each can be controlled by the weight parameter specified in each file's front matter. The slides in _index.md will always come first, though you don't have to put any slides in there if you want to.

Shortcodes

reveal-hugo comes with a variety of shortcodes that help you take advantage of some very useful Reveal.js features.

fragment shortcode

Wrap any content in the fragment shortcode and it will appear incrementally. Great for bulleted lists where you want one bullet point at a a time to appear.

- {{% fragment %}}One{{% /fragment %}}
- {{% fragment %}}Two{{% /fragment %}}
- {{% fragment %}}Three{{% /fragment %}}

frag shortcode

Like fragment but more terse - content is placed inline in a self-closing shortcode.

- {{< frag c="One" >}}
- {{< frag c="Two" >}}
- {{< frag c="Three" >}}

slide shortcode

The slide shortcode lets you set custom HTML and Reveal.js attributes for each slide - things like id, class, transition, background just to name a few. The names are the same as Reveal.js but without the 'data-' prefix.

Add the shortcode above the slide content, below the --- separator. Do not place content inside of the shortcode.

---

{{< slide id="hello" background="#FFF" transition="zoom" transition-speed="fast" >}}

# Hello, world!

---

Here's a list of documented slide attributes from the Reveal.js docs:

  • autoslide
  • state
  • background
  • background-color
  • background-image
  • background-size
  • background-position
  • background-repeat
  • background-opacity (Opacity is on a 0-1 scale, by decimal. 0=transparent, 1=opaque.)
  • 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

Additional data attributes

Check MDN for information about how these attributes work.

  • data-background-image - URL of the image to show. GIFs restart when the slide opens.
  • data-background-size
  • data-background-position
  • data-background-repeat
  • data-background-opacity

You can also pass through your own, a data- prefix will be added automatically to each one (except for id and class).

section shortcode

To create groups of slides that can be navigated vertically, surround your markdown with the section shortcode.

{{% section %}}

# Vertical slide 1

---

# Vertical slide 2

{{% /section %}}

note shortcode

Add speaker notes for each slide with the note shortcode.

{{% note %}}
Don't forget to thank the audience.
{{% /note %}}

πŸ’‘ Tip: you can also add notes by adding a note attribute to the slide shortcode.

markdown shortcode

Markdown surrounded by the markdown shortcode will not be rendered by Hugo but by Reveal.js itself. This is useful if you want to use some native Reveal.js markdown syntax that isn't supported by reveal-hugo.

{{% markdown %}}
# I'm rendered...
...by Reveal.js
{{% /markdown %}}

Maths and equations (via MathJax)

Option 1: math code block

You can author your equation inside a math code block:

```math
\tag*{(1)} P(E) = {n \choose k} p^k (1-p)^{n-k}
```

Use of the code block will automatically activate needed MathJax script for equation display.

If you want to use inline equations (like $E=mc^2$) wrap your math content in two single-$:

Albert Einstein's famous formula: $E=mc^2$

If you want to use inline equations and no math code block for auto activation is present in your slides, you need to manually enable MathJax by setting the parameter math to true in your page frontmatter.

Option 2: math shortcode

Alternatively, you can author your equation inside a math shortcode:

{{< math >}}
\tag*{(1)} \frac{n!}{k!(n-k)!} = \binom{n}{k}
{{< /math >}}

Use of the shortcode will automatically activate needed MathJax script for equation display.

For inline equations (like $E=mc^2$) use the self closing form of the math shortcode:

Albert Einstein's famous formula: {{< math "E=mc^2" />}}

For the sake of brevity, the inline content can be given as unnamed first shortcode parameter, as in the code fragment above. In a more concise form, the math content can also be assigned to a named shortcode parameter inline: {{< math inline="E=mc^2" />}}.

HTML slides

If you need to create fancier HTML for a slide than you can do with markdown, just add data-noprocess to the <section> element.

<section data-noprocess>
  <h1>Hello, world!</h1>
</section>

Reusable slides and sections

Sometimes you need to reuse a slide in the same presentation or across different presentations. reveal-hugo makes use of Hugo data templates to make both cases easy.

To create reusable slides, create a TOML (or JSON or YAML) file in your site's data directory. Give it a name that reflects its content or just slides.toml. In that file, add a key for each reusable slide. The name should reflect the slide's content and the value should be the slide's markdown.

thankyou = '''

# Thank you!

Any questions?

'''

πŸ’‘ Tip: TOML's multiline string syntax comes in handy here, note the '''.

Each key can contain one or more slides separated by --- and newlines. That way you can create reusable sections.

thankyou = '''

# Thank you!

---

Any questions?

'''

To render a slide from a data template, use the slide shortcode with a content attribute:

{{% slide content="slides.thankyou" /%}}

The part before the "." is the name of the file in the data directory. The part after the dot is the key to look up in that file.

You can use all the additional slide shortcode attributes. They will be applied to every slide in the data template.

Configuration

Customize the Reveal.js presentation by setting these values in hugo.toml or the front matter of any presentation's _index.md file.

  • reveal_hugo.theme: The Reveal.js theme used; defaults to "black"
  • reveal_hugo.custom_theme: The path to a locally hosted Reveal.js theme in the static or assets folder
  • reveal_hugo.custom_theme_compile: If set to true, the theme will be compiled with Hugo pipes (and must live in the assets folder)
  • reveal_hugo.custom_theme_options: Provide a dictionary to customize theme compilation, see Hugo's SCSS docs for a list of options
  • reveal_hugo.highlight_theme: The highlight.js theme used; defaults to "default"
  • reveal_hugo.reveal_cdn: The location to load Reveal.js files from; defaults to the reveal-js folder in the static directory to support offline development. To load from a CDN instead, set this value to https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.7.0 or whatever CDN you prefer.
  • reveal_hugo.highlight_cdn: The location to load highlight.js files from; defaults to to the highlight-js folder in the static directory to support offline development. To load from a CDN instead, set this value to https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0 or whatever CDN you prefer.
  • reveal_hugo.load_default_plugins: If set to true (default), the plugins included by default are loaded. These are markdown, highlight.js, notes and zoom.
  • reveal_hugo.plugins: (see below) An array of additional Reveal.js plugins to load. The appropriate files will need to have been copied into the static or content directory. See here for a big list of plugins you can try. The original implementation used to accept an array of javascript files (e.g. ["plugin/gallery/gallery.plugin.js"]), but now reveal-hugo can fully load plugin javascript and css. To enable this mode, You need to provide an array of plugin definition objects with name, source and an optional css, verbatim and order fields. Reveal-hugo will try to load the plugins at the path specified by source. If verbatim=true is used, the path is tried as-is. Otherwise, the path is resolved from the content dir or static dir. Finally, the reveal_cdn is prepended to the path if no other conditions are satisfied. The order field controls the order of javascript loading and will seldomly used. See plugin-example for a plugin walkthrough.

This is how parameters will look in your hugo.toml:

[params.reveal_hugo]
theme = "moon"

# the following supposes that menu is accessible in static dir
[[params.reveal_hugo.plugins]]
# Name the plugin. This should be the same name used to register a reveal-js plugin,
# for example: `RevealMenu`, `RevealNotes`
name = "RevealMenu"
source = "menu/menu.js"
css = "menu/menu.css"
# verbatim = true # should the css and source paths be used as-is ?
# order = 6 # control the order in which the plugin should be used.

Or in the front matter of an _index.md file:

[reveal_hugo]
theme = "moon"

[[reveal_hugo.plugins]]
name = "gallery"
source = "plugin/gallery/gallery.plugin.js"
css = "plugin/gallery/gallery.css"

Include any other attributes in those sections that you'd like to be fed as arguments to Reveal.initialize in snakecase, so slide_number instead of slideNumber. Params are converted from snakecase to camelcase before passing to Reveal.js. This is necessary to maintain the proper case of the parameters.

Here's an example of configuring Reveal.js parameters alongside a theme and highlight.js theme:

[reveal_hugo]
theme = "moon"
highlight_theme = "solarized-dark"
slide_number = true
transition = "zoom"

See the extensive list of Reveal.js configuration options here.

Syntax highlighting

Syntax highlighting can be done with Hugo at compile-time or using Reveal.js with the pre-installed highlight.js plugin. Presentations can use both if they wish for different pieces of code.

To do highlighting with Hugo, use the highlight shortcode and check out the hugo-hl-example example presentation.

To see an example of highlighting with Reveal.js, check out the highlightjs-linenumbers-example presentation.

By default, markdown code fences will be processed with Hugo. To turn that off, add this to your hugo.toml file:

[markup.highlight]
codeFences = false

Now, the code in the fences will be highlighted by highlight.js instead.

Custom Reveal.js themes

If you have a custom reveal theme to use (in .css form), place it in the static folder and specify it in the configuration. For example, if your css file lives here:

| static
  | stylesheets
    - custom-theme.css

Then this is what you'll put in hugo.toml:

[params.reveal_hugo]
custom_theme = "stylesheets/custom-theme.css"

Compiling a custom Reveal.js theme with Hugo pipes

Reveal.js theme customization is easiest to do by overriding variables in the SCSS or PostCSS build process. You can take advantage of Hugo pipes to do the theme compilation. In this case, your SCSS, Saas or PostCSS file needs to live in assets:

| assets
  | stylesheets
    - custom-theme.scss

If you just wanted to change the presentation colors, here's what you might put in custom-theme.scss:

@import "../reveal-js/dist/theme/template/mixins";
@import "../reveal-js/dist/theme/template/settings";

$backgroundColor: rgb(3, 129, 45);
$mainColor: #fff;
$headingColor: #fff;

To learn more about Reveal.js theme customization, check out the Reveal.js theme docs.

This is what the front matter would look like:

[params.reveal_hugo]
custom_theme = "stylesheets/custom-theme.scss"
custom_theme_compile = true

You can also add options that will be passed to Hugo's toCSS method:

[reveal_hugo.custom_theme_options]
targetPath = "css/custom-theme.css"
enableSourceMap = true

Check out the custom-theme-example presentation to see a working example.

Adding HTML to the layout

If you need to add something to the HTML layout, you can create partials that live at specific locations, depending on which presentation you want to customize and where you want the HTML inserted into the page.

Presentation Before </head> Before </body> Before closing </div> of div.reveal
All reveal-hugo/head.html reveal-hugo/body.html reveal-hugo/end.html
Root home/reveal-hugo/head.html home/reveal-hugo/body.html home/reveal-hugo/end.html
Section {section}/reveal-hugo/head.html {section}/reveal-hugo/body.html {section}/reveal-hugo/end.html

This is the recommended way to add custom CSS and JavaScript to each presentation.

πŸ’‘ Tip: In Hugo, partials live in the layouts folder:

For example, if you have HTML that is to be placed before every presentation, this would be the structure:

- layouts
  - partials
    - reveal-hugo
      - head.html
      - body.html
      - end.html

Offline development

Offline-friendly development is the default. The Reveal.js and Highlight.js files are loaded from the static directory by default. (See above for how to use a CDN instead). If you need file:/// URLs to work, make sure to set relativeURLs and uglyURLs in your hugo.toml.

relativeURLs = true
uglyURLs = true

Note: uglyURLs isn't strictly required, but it is useful if you're loading against the filesystem as it makes sure that all URLs end in .html and links point directly at them instead of to a folder.

Tutorial: Add a Reveal.js presentation to an existing Hugo site

If your Hugo site already has a theme but you'd like to create a presentation from some of its content, that's very easy.

Get the reveal-hugo theme

Method 1 (recommended): use theme as hugo module

On your site root, check for the existence of a file go.mod which marks your site as hugo module. If this file is not present yet, create it by issuing this command from site root:

hugo mod init github.com/me/my-presentation
  • Declare the reveal-hugo theme module as a dependency of your site:
hugo mod get github.com/dzello/reveal-hugo

Open hugo.toml, look for the line theme = ... and add reveal-hugo to your site's array of themes :

theme = ["your-current-theme", "github.com/dzello/reveal-hugo"]

Method 2 (traditional): use theme as git submodule

Add the reveal-hugo theme as a submodule in the themes directory:

git submodule add [email protected]:dzello/reveal-hugo.git themes/reveal-hugo

Open hugo.toml, look for the line theme = ... and add reveal-hugo to your site's array of themes :

theme = ["your-current-theme", "reveal-hugo"]

Note: Use of Hugo versions below 0.42

With hugo < v0.42, you have to manually copy a few files out of this theme into a few of your site's directories:

cd my-hugo-site
git clone https://github.com/dzello/reveal-hugo.git themes/reveal-hugo
cd themes/reveal-hugo
cp -r layouts static ../../

Files and directories are named such that they shouldn't conflict with your existing content. Of course, you should double check before copying, especially the shortcodes which can't be put under a directory.

Configure your site for presentations

Next, add the Reveal output format to your site's hugo.toml file

[outputFormats.Reveal]
baseName = "index"
mediaType = "text/html"
isHTML = true

Now you can add outputs = ["Reveal"] to the front matter of any section's _index.md file and that section's content will be combined into a presentation and written to index.html. If you already have a index.html page for that section, just change the baseName above to reveal and the presentation will be placed in a reveal.html file instead.

Note: If you specify outputs = ["Reveal"] for a single content file, you can prevent anything being generated for that file. This is handy if you other default layouts that would have created a regular HTML file from it. Only the list file is required for the presentation.

Recipes

Create a presentation from a leaf bundle or single page type

By default, reveal-hugo doesn't create presentations for single pages (i.e. pages other than _index.md) as it assumes those pages are pieces of a larger presentation in the section starting with _index.md. This might not be the case if your content is structured in a leaf bundle (the main file is then index.md with no underscore, which Hugo treats as a single page) or if you just want to put a presentation in a single file, say presentation.md. In these cases, you just need to tell Hugo to use a different layout.

If you're using a leaf page bundle, set the following in the front matter of the index.md file:

layout = "bundle"

If you're in a single page file like presentation.md, set the following in the front matter:

layout = "list"

Create a page that lists out all presentations

See this issue for a template that you can use.

Reveal.js tips

These are some useful Reveal.js features and shortcuts.

  • 's' - type 's' to enter speaker mode, which opens a separate window with a time and speaker notes
  • 'o' - type 'o' to enter overview mode and scroll through slide thumbnails
  • 'f' - type 'f' to go into full-screen mode

Here are a few useful Reveal.js-related tools:

Find many more on the Reveal.js wiki: Plugins, tools and hardware.

Implementations

Have you built something with reveal-hugo? Add a link to it here.

Changelog

  • 2018-08-03: The slide shortcode is now easier to use. An auto-closing version sits inside the slide instead of needing to surround its content and add a closing tag.

Contributing

Contributions are very welcome. See CONTRIBUTING.md for more details.

reveal-hugo's People

Contributors

ccamara avatar chatziko avatar chrisreddington avatar davidovich avatar deining avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar dzello avatar featherbear avatar flupkees avatar guilhem avatar habi avatar jamietanna avatar jerdog avatar jjasghar avatar joshed-io avatar lmorillas avatar pixelastic avatar sbruder avatar shrmnk avatar swhite24 avatar tjeukayim avatar valvin1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reveal-hugo's Issues

Setting chroma style does not work as explained in the hugo-hl-example

Thanks a ton for this theme! It is totally awesome, it is exactly what I had been dreaming about for a while, and it is super well documented!!

I followed the info in the hugo-hl-example to use chroma instead of Highlight.js but I noticed that setting pygmentsStyle = "<my-chosen-style>" in the config.toml file does not have any effect.

In order to change the style, I had to modify the default Hugo highlight:

[markup]
  [markup.highlight]
    codeFences = true
    hl_Lines = ""
    lineNoStart = 1
    lineNos = false
    lineNumbersInTable = true
    noClasses = true
    style = "<my-chosen-style>"
    tabWidth = 4

Maybe the problem is on my end, but in case others face the same issue, I thought that I would share.

regression with hugo v0.58

hi,

i'm having regression using hugo v0.58 but i can't see any error message.

symptom is it opens well the first slide but doesn't load the next and controls doesn't appear.

on three different projects 2 are broken and 1 is working but i've not yet seen what is the difference.

what about yours ?

thank you :)

Output standalone presentation for offline presentation?

Hello, I am wondering if there is any way to create a standalone presentation for offline presentation for an offline presentation in a computer where installing and setting up hugo and this theme is not possible. I thought that simply executing hugo and then copying public folder would do the trick, but it is not working without Internet connection.

background-video-loop doesn't work

The video-loop doesn't seem to work.
While background-video works great, background-video-loop only shows me a blank background.

Is there something special with a looping background video or if
{{< slide background-video="/videos/video.mp4" >}}
is working
{{< slide background-video-loop="/videos/video.mp4" >}}
should be working, too?

remove

There's no such thing as a free lunch.
		-- Milton Friedman

Running example site doesn't seem to work

I tried building the example site as mentioned in the README.md and it is throwing some sort of panic:

$ git clone https://github.com/dzello/reveal-hugo.git
$ cd reveal-hugo
$ hugo server -s exampleSite -d ../public --themesDir '../' --theme '.'
panic: AllThemes not set

... huge error message

Here is the full error message that was truncated from above:

panic: AllThemes not set
goroutine 1 [running]:
github.com/gohugoio/hugo/hugolib/filesystems.createThemesOverlayFs(0xc4201228c0, 0x0, 0xc420176fc8, 0x562f2b36c95a, 0x30, 0x562f2c2f9aa0, 0x1, 0xc4202320f0)
	/build/hugo/src/src/github.com/gohugoio/hugo/hugolib/filesystems/basefs.go:572 +0x317
github.com/gohugoio/hugo/hugolib/filesystems.(*sourceFilesystemsBuilder).Build(0xc420493e40, 0xc4202320f0, 0xc4204d00c0, 0x3c)
	/build/hugo/src/src/github.com/gohugoio/hugo/hugolib/filesystems/basefs.go:258 +0x2f0
github.com/gohugoio/hugo/hugolib/filesystems.NewBase(0xc4201228c0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10)
	/build/hugo/src/src/github.com/gohugoio/hugo/hugolib/filesystems/basefs.go:232 +0x7e7
github.com/gohugoio/hugo/helpers.NewPathSpecWithBaseBaseFsProvided(0xc420493940, 0x562f2c36bc20, 0xc4204c38f0, 0x0, 0xc4202692a0, 0x20, 0x20)
	/build/hugo/src/src/github.com/gohugoio/hugo/helpers/pathspec.go:59 +0xa1
github.com/gohugoio/hugo/helpers.NewPathSpec(0xc420493940, 0x562f2c36bc20, 0xc4204c38f0, 0xc4202692a0, 0x0, 0x562f2c8480a0)
	/build/hugo/src/src/github.com/gohugoio/hugo/helpers/pathspec.go:41 +0x4a
github.com/gohugoio/hugo/deps.New(0xc4204b0000, 0xc420493940, 0xc4204c38f0, 0x562f2c36bd40, 0xc420259860, 0x562f2c35c7e0, 0x0, 0xc4202692a0, 0x562f2c35c760, 0xc420269280, ...)
	/build/hugo/src/src/github.com/gohugoio/hugo/deps/deps.go:126 +0xb2
github.com/gohugoio/hugo/hugolib.applyDepsIfNeeded(0xc4204b0000, 0xc420493940, 0xc4204c38f0, 0x562f2c36bd40, 0xc420259860, 0x562f2c35c7e0, 0x0, 0xc4202692a0, 0x562f2c35c760, 0xc420269280, ...)
	/build/hugo/src/src/github.com/gohugoio/hugo/hugolib/hugo_sites.go:190 +0x323
github.com/gohugoio/hugo/hugolib.newHugoSites(0xc4204b0000, 0xc420493940, 0x0, 0x562f2c36bd40, 0xc420259860, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/build/hugo/src/src/github.com/gohugoio/hugo/hugolib/hugo_sites.go:134 +0x24f
github.com/gohugoio/hugo/hugolib.NewHugoSites(0xc4204b0000, 0xc420493940, 0x0, 0x562f2c36bd40, 0xc420259860, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/build/hugo/src/src/github.com/gohugoio/hugo/hugolib/hugo_sites.go:227 +0xf7
github.com/gohugoio/hugo/commands.(*commandeer).loadConfig.func3()
	/build/hugo/src/src/github.com/gohugoio/hugo/commands/commandeer.go:203 +0x119
sync.(*Once).Do(0xc4200ba890, 0xc420453968)
	/usr/lib/go/src/sync/once.go:44 +0xc0
github.com/gohugoio/hugo/commands.(*commandeer).loadConfig(0xc4200ba840, 0xc4200b0101, 0xc420092420, 0xc420092480)
	/build/hugo/src/src/github.com/gohugoio/hugo/commands/commandeer.go:188 +0x564
github.com/gohugoio/hugo/commands.newCommandeer(0xc420470101, 0xc4202bc060, 0x562f2c359be0, 0xc420492040, 0xc4204818e0, 0x0, 0x0, 0x0, 0xc4202f8c80, 0x1, ...)
	/build/hugo/src/src/github.com/gohugoio/hugo/commands/commandeer.go:99 +0x118
github.com/gohugoio/hugo/commands.initializeConfig(0x101, 0xc4202bc060, 0x562f2c359be0, 0xc420492040, 0xc4204818e0, 0x0, 0x0, 0x562f2b5020d2)
	/build/hugo/src/src/github.com/gohugoio/hugo/commands/hugo.go:111 +0x78
github.com/gohugoio/hugo/commands.(*serverCmd).server(0xc420492040, 0xc4204b8780, 0xc420215300, 0x0, 0x8, 0x0, 0x0)
	/build/hugo/src/src/github.com/gohugoio/hugo/commands/server.go:229 +0x1d8
github.com/gohugoio/hugo/commands.(*serverCmd).(github.com/gohugoio/hugo/commands.server)-fm(0xc4204b8780, 0xc420215300, 0x0, 0x8, 0x0, 0x0)
	/build/hugo/src/src/github.com/gohugoio/hugo/commands/server.go:83 +0x54
github.com/gohugoio/hugo/vendor/github.com/spf13/cobra.(*Command).execute(0xc4204b8780, 0xc420215200, 0x8, 0x8, 0xc4204b8780, 0xc420215200)
	/build/hugo/src/src/github.com/gohugoio/hugo/vendor/github.com/spf13/cobra/command.go:756 +0x46a
github.com/gohugoio/hugo/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc4202f8780, 0xc42047f090, 0xc420482280, 0xc420453ee8)
	/build/hugo/src/src/github.com/gohugoio/hugo/vendor/github.com/spf13/cobra/command.go:846 +0x30c
github.com/gohugoio/hugo/commands.Execute(0xc4200ae010, 0x9, 0x9, 0xc420453f78, 0x562f2b35fe0e, 0xc420092058, 0x0)
	/build/hugo/src/src/github.com/gohugoio/hugo/commands/hugo.go:77 +0xc0
main.main()
	/build/hugo/src/src/github.com/gohugoio/hugo/main.go:27 +0x7d

Not sure if the instructions need to be fixed or the configuration or what.

Versions:

$ hugo version
Hugo Static Site Generator v0.42.1 linux/amd64 BuildDate: 2018-06-13T20:49:30+0200

Using Arch Linux.

Sections not joined to index

Even with outputs=["Reveal"] in sub-sections, I am finding that hugo new is not merging the content sections into a single presentation for some reason.

Here is a bash script that creates a test repository:

hugo new site test-reveal
cd test-reveal
git init .
git submodule add [email protected]:dzello/reveal-hugo.git themes/reveal-hugo

# Create the config.toml
cat >> config.toml << EOF
theme = "reveal-hugo"
disableKinds = ["sitemap", "RSS", "categories"]

[outputFormats.Reveal]
baseName = "index"
mediaType = "text/html"
isHTML = true
EOF

mkdir -p content/section

# Create the main content
cat > content/_index.md << EOF
+++
title = "My presentation"
outputs = ["Reveal"]
+++

# Test

This is an example
EOF

# Create a section
cat > content/section/_index.md << EOF
+++
title = "Subsection"
outputs = ["Reveal"]
+++

# Subsection

This is a section
EOF

Once created, running hugo creates two separate presentations:

$ hugo

                   | EN  
+------------------+----+
  Pages            |  2  
  Paginator pages  |  0  
  Non-page files   |  0  
  Static files     |  2  
  Processed images |  0  
  Aliases          |  0  
  Sitemaps         |  0  
  Cleaned          |  0  

Total in 8 ms
$ tree public
public
β”œβ”€β”€ index.html
β”œβ”€β”€ reveal-hugo
β”‚Β Β  └── plugin
β”‚Β Β      └── notes
β”‚Β Β          β”œβ”€β”€ notes.html
β”‚Β Β          └── notes.js
└── section
    └── index.html

4 directories, 4 files

As you can see, the section folder is still generated. Any idea what went wrong? Is this some behavior that maybe changed in hugo?

I'm using Arch Linux, hugo version:

$ hugo version
Hugo Static Site Generator v0.42.1 linux/amd64 BuildDate: 2018-06-13T20:49:30+0200

Your theme's demo is not working on the Hugo Themes website

Hello @dzello your theme's demo is not generating

When I test your theme's Example Site I get the following ERROR:

Error: Error building site: "/hugoThemes/reveal-hugo/exampleSite/content/home/shortcodes/slide.md:178:1": failed to render shortcode "section": "/hugoThemes/reveal-hugo/layouts/shortcodes/slide.html:26:33": execute of template failed: template: shortcodes/slide.html:26:33: executing "shortcodes/slide.html" at <index . $template>: error calling index: cannot index slice/array with type string

Can you please look into it?

Thank you.

CC / @digitalcraftsman

Font Size

How can i change the font size. I just found the <small> Tag, but this destroys my markdown.

Organizing content in subfolders breaks my custom theme

I would like to use a single reveal-hugo instance to put all my slides. Therefore, I would like to group slides from my job1, job2, association and personal slides. I though of creating a structure like this:

content
β”œβ”€β”€ job1
β”‚   β”œβ”€β”€ presentation1
β”‚   β”‚    β”œβ”€β”€ page.md
β”‚   β”‚    └── _index.md
β”‚   └── presentation2
β”‚         └── _index.md
└── personal
    β”œβ”€β”€ presentation2
    β”‚    └── _index.md
    └── presentation2
          └── _index.md

While IMHO this makes much sense because I can apply different partials per purpose, I noticed that my custom scss theme was not applying for content in content/job1/presentation1/page.md.

I am wondering if my approach makes sense and/or if there is a way to overcome the described problem.

vertical adjust to space

Thank you for your great work!

Is there a simple way to adjust slides vertically. Some of my slides have quite a lot of text and also images, and I would like to be able to write them "productively" ie without having to resize my images and reduce my text (which I know is probably a good thing).

Thanks,
nick

Plugin path works in frontmatter of _index.md but not in config.toml

I'm finding that my plugin configuration works when the array is in the frontmatter of _index.md but not when it's in my config.toml file.

When in _index.md, the HTML that is generated is:

<script type="application/json" id="reveal-hugo-site-params">{"height":540,"highlight_theme":"atom-one-dark","margin":0.1,"max_scale":1,"min_scale":0.1,"plugins":["reveal-js/plugin/menu/menu.js"],"theme":"white","width":960}</script>
<script type="application/json" id="reveal-hugo-page-params">{"parallax_background_image":"https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg","templates":{"fish":{"background-image":"https://source.unsplash.com/nI3bUW1Xqik/420x600","background-size":"50%","class":"fish","state":"opacity50"}},"theme":"black"}</script>

and when in the config file, it is:

<script type="application/json" id="reveal-hugo-site-params">{"height":540,"highlight_theme":"atom-one-dark","margin":0.1,"max_scale":1,"min_scale":0.1,"theme":"white","width":960}</script>
<script type="application/json" id="reveal-hugo-page-params">{"parallax_background_image":"https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg","plugins":["reveal-js/plugin/menu/menu.js"],"templates":{"fish":{"background-image":"https://source.unsplash.com/nI3bUW1Xqik/420x600","background-size":"50%","class":"fish","state":"opacity50"}},"theme":"black"}</script>

Is there a different path I need to use when in config.toml vs. _index.md?

Duplicate images in public folder

While debugging #41, I noted that some images are duplicated in public folder after being processed by hugo command.

This is my current setup:

config.toml:

baseURL = "/"
languageCode = "en-us"
title = "My slides"

theme = "reveal-hugo"

relativeURLs = true
uglyURLs = true

[outputFormats.Reveal]
baseName = "index"
mediaType = "text/html"
isHTML = true

I am using page bundles for storing images, making my typical page structure as follows: /content/my-slide/img

When processed by hugo command, those images are duplicated, in public/img folder + public/my-slide/img folder. I am wondering what happens if I have two different images with same name in two folders.

not compatible with hugo 0.60+

because hugo change Markdown-Parser form "Blackfriday" to "Goldberg" slide seperation seems to be broken (hugo changelog)

I'm not entirely sure how you insert the section in the markdown but your method, doesn't seem to work with the new parser.

How to achieve incremental bullets?

I am wondering if there is a way to achieve incremental bullets functionality.

I know we can use fragments in either verbose or compact notation, but both of them parse the * character used for bullets as a character, not a bullet. On the other hand, if I put the bullet outside the fragment, the bullet point gets rendered even though its content is not yet visible.

image border problem

Hello, I just discoverd hugo and reveal hogo and so far it was great and wonderful experince.
thanks a lot

I'm having a problem with image and svg border
I tried to edit the theme

.reveal section img {
  margin: 0px 0px;
  background: rgba(255, 255, 255, 0.12);
  border: 0px solid #363636;
  box-shadow: 0 0 0px rgba(0, 0, 0, 0.15); }

.reveal section img.plain {
  border: 0;
  box-shadow: none; }

.reveal a img {
  -webkit-transition: all .15s linear;
  -moz-transition: all .15s linear;
  transition: all .15s linear; }

.reveal a:hover img {
  background: rgba(255, 255, 255, 0.2);
  border-color: #F3DA4C;
  box-shadow: 0 0 0px rgba(0, 0, 0, 0.55); }

so far it still shows the shadow and border

thanks

Failing to use a custom scss theme

TLDR: I created a custom scss theme but hugo can't compile it. Probably because it doesn't find mixins.

I want to use a custom scss theme on my slides (in fact I would like to create several of them) so I did the following:

  1. Add the following lines to my frontmatter:
[reveal_hugo]
custom_theme = "custom-theme.scss"
custom_theme_compile = true
  1. Created the file assets/custom-theme.scss with the following content:
// Default mixins and settings -----------------
@import "../template/mixins";
@import "../template/settings";
// ---------------------------------------------



// Override theme settings (see ../template/settings.scss)

// My scss properties here

// Theme template ------------------------------
@import "../template/theme";
// ---------------------------------------------
  1. When running hugo-serve I get the following error:

error: failed to transform resource: SCSS processing failed: file "stdin", line 10, col 1: File to import not found or unreadable: ../template/mixins.

What am I doing wrong? My guess is that the @import routes are wrong, but I am not sure where should I point them.

IE browser support

I just stumbled upon an issue with viewing reveal-hugo in IE11.

Nothing renders on page and the page stays blank, except for custom HTML.
Compability view reveals full presentation vertically with no ability to scroll.

This issue is present on my localhost and on reveal-hugo demo page.

revealjs.com renders fine in IE.
reveal-hugo demo does not render in IE.

There is IE support for revealjs.

How to generate list page for all presentations

I'm trying to render a index page that would list links to all presentations. So far without much luck. This is the tree:

$ tree content

content
β”œβ”€β”€ posts
β”‚Β Β  β”œβ”€β”€ hello.md
β”‚Β Β  └── second.md
└── slides
    β”œβ”€β”€ _index.md
    └── presentation
        └── _index.md

Atm I'm expecting that /slides/index.html includes a link to /slides/presentation/, but whatever I try, nothing seems to work. I only get an empty presentation there. Is this even supported?

Reusable slides - subfolders in data doesn't work

First of all thank you for reveal-hugo :)

i've started working with reveal-hugo very recently and i hope i've not missed something on this issue.

we planned to use reveal-hugo at work for our different support. For this I would like to have in a seperate repository reusables slides that I'll plug using git submodules in data folder.

it looks like today we can only import reusable slides in a file at the root folder of data. For example ./data/home.tomlwith a variable reusable which leads to a slide content declared as data.home.reusable and works well.

In order to use a separate repo for global reusable slides and allowes user to create their owns i've tested to import my repo in a subfolder ./data/global/home.toml which leads to a content declared as data.global.home.reusable.

This subfolder looks compatible with hugo standard but unfortunately doesn't work.

Is there a tip to make it works ?

For my usecase I've tried to trick using symbolic links but unfortunately it is not supported in data folder by hugo :(

Using fragment shortcode and bullet list

I'm not succeeding in using fragment shortcode and bullet list :

{{% fragment %}}- *item* __1__ {{% /fragment %}}

{{% fragment %}}- *item* __2__ {{% /fragment %}}

{{% fragment %}}- *item* __3__ {{% /fragment %}}

it renders well italic and bold but it doesn't render bullet list. Is there a tip for that ?

I've made several tests using {{< or * for the bullet list but the result is always the same.

I also need empty line which in my mind should not be expected.

support for print-pdf

This is a enhancement request.
If to the URL ?print-pdf is appended, then when print option is chosen in the browser, revealjs can print pdf. Getting this to work in hugo would be very nice.

background images don't load in sections

Good afternoon,

I've just updated to the latest and greatest version of Hugo (v0.64.1) and in combination with the current version of reveal-hugo I noticed that background-images no longer load when the slides are within a section. For example:

  • These backgrounds don't load:
+++
weight = 20
+++
{{% section %}}
{{< slide background-image="/images/containers.jpg" background-opacity="0.2" >}}

### Awesome test slide
---

{{< slide background-image="/images/containers.jpg" background-opacity="0.2" >}}

### And yey another cool slide... 

{{% /section %}}
  • These backgrounds do load:
+++
weight = 20
+++
{{< slide background-image="/images/containers.jpg" background-opacity="0.2" >}}

### Awesome test slide
---

{{< slide background-image="/images/containers.jpg" background-opacity="0.2" >}}

### And yet another cool slide... 

And... I use a lot of background images 😎

For the sake of testing I started with a fresh install of both hugo, reveal-hugo and my presentation, not using my custom css.

Cheers,

David

Templates don't work when defined in `config.toml`

Hi,

I'm getting an error message when trying to use a slide template on Hugo 0.54.0. Using the latest commit on master of this repo at time of writing (can't figure out the exact one, as I did a subtree pull).

config.toml has this:

[params.reveal_hugo.templates.title]
class = "title"
background = "#1D74BC"

Markdown file is thus:

+++
title = "Overview"
outputs = ["Reveal"]
weight = "10"
+++

{{< slide id="overview" template="title" >}}

Error is:

ERROR 2019/03/05 18:12:58 "/Users/deejay/workspace/k8s-course/slides/content/home/state.md:7:1": failed to render shortcode "slide": failed to process shortcode: "/Users/deejay/workspace/k8s-course/slides/themes/reveal-hugo/layouts/shortcodes/slide.html:1:1": execute of template failed: panic in Execute: reflect: call of reflect.Value.Type on zero Value. See "https://github.com/gohugoio/hugo/issues/5327" for the reason why we cannot provide a better error message for this.
Total in 29 ms
Error: Error building site: "/Users/deejay/workspace/k8s-course/slides/content/home/overview.md:7:1": failed to render shortcode "slide": failed to process shortcode: "/Users/deejay/workspace/k8s-course/slides/themes/reveal-hugo/layouts/shortcodes/slide.html:1:1": execute of template failed: panic in Execute: reflect: call of reflect.Value.Type on zero Value. See "https://github.com/gohugoio/hugo/issues/5327" for the reason why we cannot provide a better error message for this.

The issue is here: https://github.com/dzello/reveal-hugo/blob/master/layouts/shortcodes/slide.html#L24

($.Site.GetPage $.Page.Section).Params.reveal_hugo.templates is nil if one has put the template definition in config.toml, which is a supported use case according to https://reveal-hugo.dzello.com/#/36/1

I've worked around this by changing the shortcode, so there's no rush for a fix in my case, but maybe other users will encounter this.

Thanks for all the hard work, I've generally had a good experience with the theme and we use it for creating presentations as part of training courses.

404 when rendering presentation from leaf bundle `index.md` instead `_index.md` .

I'm trying to create a listing page for all the presentations on my site.
Here is how I need to organize my content in order to create a list of my presentations (this is required by the theme I use):

content/
β”œβ”€β”€ presentations
β”‚   β”‚
β”‚   β”œβ”€β”€ _index.md
β”‚   β”‚
β”‚   β”œβ”€β”€ my-first-presentation
β”‚   β”‚   β”œβ”€β”€ image1.jpg
β”‚   β”‚   └── index.md
β”‚   └── my-other-presentaion
β”‚       └── index.md
β”‚
└── blog

I have all of my presentations at presentations branch with leaf bundles for each presentation under specialized folders.

Unfortunately, I get error 404 when opening a presentation if I organize my content this way. This happens when I use index.md as presentation file and not _index.md.
Presentation renders fine when I use _index.md instead of index.md, but then the presentation is not listed on presentaions list page, because it becomes a branch bundle with _index.md.

Is there a way to make revealjs work with index.md leaf bundles?

Thanks :)

hugo env

Hugo Static Site Generator v0.54.0/extended windows/amd64 BuildDate: unknown
GOOS="windows"
GOARCH="amd64"
GOVERSION="go1.11.5"

Theme minimo

Footnotes do not link properly

I am trying to apply footnotes via Blackfriday's implementation.

This is a footnote.[^1]

[^1]: the footnote text.

The markup is correctly rendered but clicking on the links always takes me back to the start of the presentation instead of the reference.

Markdown in notes

Currently noes do not support markdown (or I haven't figured out how to use it). Following code renders * instead of formatting the text.

{{% note %}}
You found the **speaker notes!**
{{% /note %}}

shortcode HTML seems to be filtered out

I'm having trouble making the notes and fragments shortcodes work.

When I use the note shortcode, I end up with this in the output (via dev window or w/in the public directory):

<h4 id="i-believe-in-multicloud">I believe in multi-cloud.</h4>
<!-- raw HTML omitted -->
</section><section>

When I use the fragment shortcode, the end up with dangerous characters being escape, so there are things like

&lt; span> ....

Am I missing a configuration setting somewhere?

fragment-interaction with lists/multi-line-fragments

I am encountering some occasional problems when using fragments with lists. I am new to Hugo (great work on the theme BTW) so I am not sure if I am missing something or this is a bug.

Take this for example:

# Foo
Foo: bar.

__Foo Bar__: {{% fragment %}} __Foo__ {{% /fragment %}} {{% fragment %}} __Bar__ {{% /fragment %}}

{{% fragment %}}
* Foo
* Bar
{{% /fragment %}}
  1. I would expect the third fragment containing the list to be hidden but it is not (theme is "moon"). Am I missing something, is this a scenario where one should use the reveal markdown processor or use HTML directly?
  2. What about "fragment lists" where each item appears after another. What would be the go-to solution there?

Section with Markdown shortcode inside it excludes slides from the resulting section

If you put a Markdown shortcode inside a Section, slides after the markdown close tag doen't belong to the current Section.

Example:

{{% section %}}

# My Section: Slide 1

Here the section begins...

---

{{< markdown >}}

# My Section: Slide 2

## I'm a mardown slide, but with custom HTML

<section data-noprocess>
  <h1>Hi, Reveal JS!</h1>
<section>

{{< /markdown >}}

---

# My Section (?): Slide 3

* this is not
* in the
* section any more :(

{{% /section %}}

Am I doing something wrong here? Or this issue is just there?

Nested list level3

I usually use lists with bullets for my presentation.

With 2 levels, no issue, rendering works as expected. With 3 levels however, I need more than 4 spaces for indentation.

* item 1
* item 2
  * item 2a <-- 2 spaces is OK here
    * item 2ai <-- 4 spaces here is not enough, but 5 is OK

Any reason for that?

Thanks

How can I pass a parameter to a plugin's initialization?

I'd like to use the reveal.js-menu plugin.

I started with the sample programming quotes repository.

I've copied the menu plugin repository into ./themes/reveal-hugo/static/reveal-js/plugin/menu/.

I've edited content/_index.md and added

[reveal_hugo]
plugins = ["reveal-js/plugin/menu/menu.js"]

to the front matter.

I'd like to set so of the menu plugins parameters, e.g. side, but I can't find any documentation or figure it out from first principles.

I've tried

plugins_menu_side = "right"

In the front matter, to no avail.

Is this possible?

Mathsjax support

I am currently trying to extend this wonderful project to serve me well during the rest of my PhD,
so I am attempting to include mathjax to be able to render equations.

However, I am struggling a bit (partly because I have almost no webdev experience).

I have attempted two things:

  1. Adding support via hugo
    First I added the script from here as a partial, and then added {{ partial "layout/mathjax_support.html" . }} in baseof.reveal.html.
    This works, however I don't like that it is always on, and would like to do it properly to be enabled/ disabled via parameter.

  2. Loading the math.js plugin via reveal.
    Adding
    <script type="text/javascript" src="{{ printf "%s/plugin/math/math.js" $reveal_location | relURL }}"></script>
    to the javascript.html should have enabled the plugin, and then allow me to render

{{< markdown >}}
## Math Support
  `\\() J(\theta_0,\theta_1) = \sum_{i=0} $\\)`
{{< /markdown >}}

but unfortunately this does not work.

I think I would prefer the first option, as it does not require the markdown shortcode in addition to the backticks, but am unclear on how to make his parameterizeable via the _index.md.
At the same time, I would like to add the option to add plugins from the standard reveal plugin location, which I will do once I understand why loading the math.js plugin seems to fail.

Thank you for your time and this project, I hope to contribute more in the future.

Is it possible to remove partials for some slides?

Thanks so much for this project πŸ™‚

I set a logo to a presentation (thanks to your great example), but I would like to be able to remove the logo on some slides, for instance, using a slide shortcode.

So, is it possible not to have partials apply to a class defined in a shortcode?

I know how to define a class for those slides

{{< slide class="nologo" >}}

but then I don't know how to remove the partials from that class...

Thanks for the help! πŸ™‚

Reveal Theme Demo on Hugo website contains 3rd party tracking

Hello again @dzello

Currently I am one of the maintainers of the Hugo Themes repository.

Recently I audited the Hugo Themes website and it has come to my attention that your theme's demo has third party tracking enabled.

     \reveal-hugo\exampleSite\layouts\partials\reveal-hugo\body.html:
        <script async src="https://www.googletagmanager.com/gtag/js?id=UA-24132749-1"></script>
        <script>
         window.dataLayer = window.dataLayer || [];
         function gtag(){dataLayer.push(arguments);}
         gtag('js', new Date());
         gtag('config', "UA-24132749-1");
        </script>

Can you please remove the Google Tag Manager tracking script?

Once you look into this please let me know.

Thank you!

Notes doesn't work with slide shortcut

I having issues getting the slide shortcut to work with notes. It ends up ignoring the note and rendering it on the slide rather than than the speaker notes.

I have used:

{{<slide notes="^Note:" >}}

# Blah

Some text 

Note:
A note

As specified in the Reveal.js docs.

I've also tried:

{{< slide separator-notes="^Note:" >}}

As I noticed that notes rendered to data-notes in the HTML source and it should be data-separator-notes.

What does work is using the notes shortcut {{% notes %}}.

background-iframe not showing in browser (localhost)

I have a slide that I would like a webpage to load in the background. The snippet of markdown is:

---

{{< slide background-iframe="https://asciinema.org/a/268429?speed=10" >}}

# Installing Arduino

---

But the iFrame isn't showing in my browser.

I'm running hugo locally while I create my slide deck and I'm using firefox (69).

I can see the source of the page has this section:

<section data-noprocess data-shortcode-slide
      data-background-iframe="https://asciinema.org/a/268429?speed=10">
  

<h1 id="installing-arduino">Installing Arduino</h1>

</section>

and using webdeveloper tools in the console I can see the get request for the page

GEThttps://asciinema.org/a/268429?speed=10
[HTTP/2.0 200 OK 333ms]

Request URL:https://asciinema.org/a/268429?speed=10
Request method:GET
Remote address:109.107.38.78:443
Status code:
200
Version:HTTP/2.0

I can't see why my iframe isn't showing the webpage in the background

But maybe there's in issue with it? or running from localhost?

Is this an issue with firefox or am I doing something wrong?

Add logo to all slides of one presentation

What is the best Hugo friendly way to add a logo image to all of the slides at the same time for just one presentation? Then add a different logo for another presentation?

I use reveal-hugo with an existing Hugo site via theme inheritance functionality.

I found some suggestions specific to Reveal.js, like adding <img ... > to the page body, or changing CSS, but I couldn't get it to work in Hugo.

It's probably complicated, but I'd like to request a feature of adding logo functionality with front matter, like this:

+++
title = "My presentation"
outputs = ["Reveal"]
[reveal_hugo]
theme = "white"
logo = "/image.png"
+++

Thanks for reveal-hugo theme.

Can't figure out how to get the custom theme going.

I've read the notes and put in and getting all sorts of errrors.

The instructions in the configuration section below are different to the demo example.

I'm quite new to Hugo so it's probably me messing up

Feature proposal - custom CSS

I developed a feature that allow to add an additionnal CSS to modify small part of an existing theme or create new CSS class.

Today official way is to use partials and insert style inside head.html. I prefer using a separate file.

So if you add an attribute :

[reveal_hugo]
custom_css = "css/custom.css"

in your config.toml or _index.html meta. It will loaded automatically that file.

It requires to copy custom.css in static/css/custom.css in the example.

@dzello what is your thought about this feature ? If I do a PR do I change also Custom CSS Example

Maybe if you like the idea it would be also interesting to add custom_js settings ?

Add a config.yaml to the theme for common keys

From RΓ©gis:

Do you know you can add a config.yaml file to your theme and most of its keys will be consumed by the project? So you can have your custom output format there, and let the user simply assign it to whatever needed.

This will avoid the need to configure outputFormat manually.

Navigation breaks when using more than one shortcode in same slide

Provided the following code:

+++
title = "My title"
description = ""
outputs = ["Reveal"]

[reveal_hugo]
theme = "white"

[reveal_hugo.templates.bg-dark]
class = "bg-dark"
background = "#000"

+++

{{< slide template="bg-dark" >}}
{{< slide background-image="https://reveal-hugo.dzello.com/images/alex-litvin-790876-unsplash.jpg" >}}

## Slide one


---

## Slide 2

This should appear on the right, not below the previous one.

All slides after slide 1 appear below slide 1, instead of appearing on the right, as expected (unless creating a section, but that's not the case). The problem is solved whenever I comment one of the shortcodes I am using, but unfortunately, I need both of them (at least!).

Offline speaker notes break

I'd like to run my presentation offline, so I use the following settings:

uglyurls = true
relativeURLs = true

[params.reveal_hugo]
reveal_cdn ="reveal-js"

Works as aspected except for the speaker notes. In file layouts\_default\baseof.reveal.html there are the following lines to load the dependencies:

// the notes plugin can't run off the CDN b/c the HTML file isn't there
{ src: '{{ "reveal-js/plugin/notes/notes.js" | relURL }}', async: true }

So my point to discuss is to just change is it to:

{ src: '{{ $reveal_cdn }}/plugin/notes/notes.js', async: true }

Because yes, it will break using a CDN because the HTML is not there. But if reveal-js is not there locally, it will break anyway.

Set css for a single slide

Hi,

I try to make the font-size smaller for a table, but I don't find a way to set a css for that in only one special slide?

Missing reveal's data-background-opacity property

I am new to reveal-hugo, and I may be missing some things, but I could not figure out how can I use reveal's data-background-opacityproperty.

I have tried to use it within a shortcode {{< slide background-image="img/whatever.jpg" data-background-opacity="0.3">}} or even within a template in _index.md toml's, without success

[reveal_hugo.templates.bg-dark]
class = "bg-dark"
background = "#000"
data-background-opacity = "0.3"

Am I missing something?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.