RawContent *and* shortcodes?

Dear all,

Following on my (old) question https://discuss.gohugo.io/t/integration-with-reveal-js-to-present-slides/3047 about integrating reveal.js and hugo, which successfully ended up by the advice to use the RawContent variable.

I’d actually want to combine this with (custom) shortcodes (mainly to add css class specifications), e.g. something like :

---

# General O2 news

+++

Bye bye CWGs

+++

Hello WPs.

+++

{{< figure src="/talk/2017-05-09-mrrtf-hackathon/O2-WPs-v3.5.png" class="fullscreen" >}}

But currently what I get in my output slides is :

{@{@HUGOSHORTCODE-1@}@}

Not completely sure I grasp completely the processing pipeline, so may be what I want to do is simple not possible ? or am I just not trying correctly ? :wink:

Thanks,

I used Hugo all the time for reveal.js at work. Can you point me to a repo?

You use a fairly old Hugo version, but I don’t think an upgrade will solve your problem. If I read the code correctly, raw content is … RAW content, i.e. unprocessed, and that means no shortcode processing etc.

Actually with a more recent version (0.20) the output I get is :

{{< figure src="/talk/2017-05-09-mrrtf-hackathon/O2-WPs-v3.5.png" class=“fullscreen” >}}

which is indeed the raw content. That I can understand better than {@{@HUGOSHORTCODE-1@}@} :wink: but then it means I have to find another way to achieve what I want…

Thanks,

Did you authored your slide in Markdown (which I’d like to) or in HMTL directly ?

Ideally what I’d like to achieve is a simple (md) way to deal with big text and image splits. For instance :

[fit] my text

would make “my text” fit the full width of the slide

(yes, this is shamelessly inspired by what https://www.decksetapp.com/ is able to do)

So I guess in a sense what I want is to find a way to extend the Markdown understood by Hugo…

Anyway, my repo can be seen at https://github.com/aphecetche/site/tree/master/content/talk (viewable at aphecetche.github.io/#talks). Not terribly interesting for the general public though :wink:

1 Like

You could try to wrap your slides in a markdown type shortcode that uses markdownify … maybe.

Hi bep,

Not sure I understand what a “markdown type shortcode” is. Could you please elaborate a bit ?

Thanks,

@aphecetche This is all in the documentation if you read up on shortcodes. This is from the new docs being worked on , but the same info can more or less be found in the existing docs…

How to declare inside your content:

https://hugodocs.info/content-management/shortcodes/#shortcodes-with-markdown

How to create your own shortcode templates:

https://hugodocs.info/templates/shortcode-templates/

My suggestion was a little bit off: What you want is a shortcode that “does nothing”, so you get to keep the markdown in the generated HTML; maybe wrap it in a div so the slide library can “get it”.

1 Like

@aphecetche Can you tell me more about how you are creating your reveal project? For example, are you creating one markdown file per section of the slide show (in this case, I mean in reveal lingo, where you have up-down navigation), or are you trying to create a markdown file per slide?

A source repo would help…

If I may make an assumption, I’m guessing you’re letting Reveal render the markdown for you on the client via a data property in a section?

Were you able to make any progress? I came looking for the exact same problem.

I want to be able to use shortcodes but also want to create slides in there using remark features.

Right now I have to repeat all of it


{{< left>}}

# Slide 1

{{< /left >}}

{{< left>}}

# Slide 1

Next step on slide 2.

{{< /left >}}

Instead I want to do this

{{< left>}}

# Slide 1

--

Next step on slide 2.

{{< /left >}}

Hello this is a 2 year old topic, it is highly unlikely that you will get an answer. Also even if you did get an answer, Hugo has been overhauled in the past two years.

Please open a new topic describing your issue and provide a sample repo with your project’s source code.