joshed-io / reveal-hugo

📽️ Create rich HTML-based presentations with Hugo and Reveal.js
https://reveal-hugo.dzello.com/
MIT License
689 stars 146 forks source link

Notes data content from toml file #78

Open saratrajan opened 4 years ago

saratrajan commented 4 years ago

Great work on this theme, team!

I am having a slight glitch while trying to move all my notes into a dedicated data/notes.toml.

For eg. I have added below to my data/notes.toml

slideonenote = '''

Hello to audience

'''

.. and I am adding it to my _index.md like below


---

<some content for the slide>

{{% note %}}
{{< slide content="notes.slideonenote" >}}
{{% /note %}}

---

It does not work. Notes section is blank on my Presenter Mode.

Any tips here? Is this supported yet?

Note: I tried moving {{% note %}} inside of my toml and it started appearing as slide text (visible) on my app!

joshed-io commented 4 years ago

Thanks for the kinds words!

I haven't tried to nest a slide shortcode inside of a note shortcode before, though I understand what you're attempting to do. I'll have to look at what happens and the resulting HTML created.

The {{% note %}} not working in toml is expected, Hugo will only process shortcodes that originate inside of content files.

saratrajan commented 4 years ago

Thanks for the quick response! I would eagerly await to hear back on your attempt. Would be nice to conceal the presenter notes from the main markdown, to maintain slides neater. Glad you understood what I was trying to achieve here.

Cheers.

gesinn-it-gea commented 2 years ago

I had a similar problem when I tried to use Hugo's figure shortcode in a /data/*.toml:

gallery = '''
{{< figure src="/media/logos/1.svg" height="100" >}}
{{< figure src="/media/logos/2.svg" height="100" >}}
'''

I wanted to create a slide with an image gallery that is reused in multiple presentations. Any hints / alternate approaches are welcome.