Vertical sections not displaying

#1

I have this as my sample Hugo page:

+++
title = "Rob's first Hugo reveal site"
outputs = ["Reveal"]
[reveal_hugo]
theme = "night"
margin = 0.2
weight = 1
+++

# Slide one

Text for slide one.

---

# Slide two

Text for slide two.

---

{{% section %}}

# Slide three - vertical slide one

Text for slide three - vertical slide one

---

# Slide three - vertical slide two

Text for slide three - vertical slide two

{{% /section %}}

But this is what I see… can anyone tell me what I am doing wrong?

1 Like
#2

To debug your site we have to see the code (not just the contents of one content file). Please read #support issues for examples, and follow the advice at Requesting Help.

2 Likes
#3

Thanks for the hint @maiki, I have uploaded a copy of my sample here: https://github.com/robertmarkbram/hugo-sample

2 Likes
#4

Is there any possibility that the issue is to do with line-endings?

#5

Hi,

I think this may have to do with the recent changes in 0.55 around shortcodes: https://gohugo.io/news/0.55.0-relnotes/

The easiest way to resolve is probably to let the theme author know so they can fix it in the theme directly. You may have to wait for them to get around to doing it, and then update your copy of the theme to the latest version after.

The fastest is to do it yourself: overwrite the section shortcode by creating a shortcode at yoursite/layouts/shortcodes/section.html. Copy the contents of the theme’s theme/layout/shortcodes/section.html, and add

{{ $_hugo_config := `{ "version": 1 }` }}

to the beginning, as discussed in the relnotes I linked to above.

2 Likes
#6

For future reference, this is what I did to fix this (until the reveal creators update the theme).

$ cp ./themes/reveal-hugo/layouts/shortcodes/section.html ./layouts/shortcodes

$ tree layouts/
layouts/
`-- shortcodes
    `-- section.html

1 directory, 1 file

Edit that section.html to give it the following contents:

$ cat layouts/shortcodes/section.html
{{ $_hugo_config := `{ "version": 1 }` }}
<section data-shortcode-section>
{{ .Inner }}
</section>

And now the section code works as I expected it from following previous (now out of date) tutorial matter.

Rob
:slight_smile:

2 Likes