Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fragment within section seems to throw an error #77

Open
asongtoruin opened this issue Feb 26, 2020 · 7 comments
Open

fragment within section seems to throw an error #77

asongtoruin opened this issue Feb 26, 2020 · 7 comments

Comments

@asongtoruin
Copy link

Using a fragment within a section seems to cause the output to render incorrectly. This may be connected to #65 as I'm using a newer vesion of Hugo (hugo version gives Hugo Static Site Generator v0.65.3-211BA42A windows/amd64 BuildDate: 2020-02-23T09:58:40Z). Using the basic set-up detailed in the readme, and an _index.md file consisting of:

+++
title = "Test"
outputs = ["Reveal"]
+++

# First slide

---

{{% section %}}

## Second Slide

{{% fragment %}} Hello {{% /fragment %}}

---

## Third Slide

{{% /section %}}

The fragment doesn't render properly:

incorrectly rendered fragment

@joshed-io
Copy link
Owner

Can you try with this in your config.toml?

[markup.goldmark.renderer]
unsafe = true

@asongtoruin
Copy link
Author

I've already got that set. Full config.toml is:

baseURL = "http://example.org/"
languageCode = "en-us"
title = "Test"

relativeURLs = true
uglyURLs = true

theme = "reveal-hugo"

[markup.goldmark.renderer]
unsafe = true

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

@joshed-io
Copy link
Owner

Ok thanks. I'll try to have a look this weekend and see what's going on.

@ccamara
Copy link
Contributor

ccamara commented Mar 29, 2020

I can confirm this undesired behaviour as well

Using hugo-extended-0.66.0
and both, fragment and frag shortcodes within a section.

@LongLiveCHIEF
Copy link

I've been giving this one a lot of thought, and I'm wondering if we can use sections/types of hugo to our advantage, and instead of having a {{% section }} shortcode, we use a content type and layout page to create each vertical slide.

Example directory structure (with fake subject matter that should be self-explanatory):

content
├── all-about-energy-drinks
│   ├── _index.md
│   ├── benefits.md
│   ├── drawbacks.md
│   ├── monster
│   │   ├── _index.md
│   │   ├── original.md
│   │   └── ultra.md
│   └── rockstar
│       ├── _index.md
│       ├── juiced.md
│       └── thermo.md
└── all-about-pizza
    ├── _index.md
    ├── papa-johns
    │   └── _index.md
    ├── pizza-hut
    │   └── _index.md
    ├── popular-toppings.md
    └── sauces.md

So here we have two root reveal presentations, and as an example, the energy drinks outline would look like this:
Untitled

ordering and weighting could work the same it does now, so you could order the vertical slides in whatever order you want using weight, and you could fit the sections in wherever you needed to in the outline by using weight on the _index.md of the section page (in this example all-about-energy-drinks/monster/_index.md would have a weight in the frontmatter that would place it after drawbacks slide but before the rockstar vertical slide group.

I'm still working through this, but i think it's possible to do it so it's not even a breaking change to existing users, allowing them to upgrade reveal-hugo without disruption.

@LongLiveCHIEF
Copy link

we could use the layout=vertical in the frontmatter, and then create a vertical layout template that and use a filter that gets the Section name and the template would just loop through them and wrap them in <section> html tags for reveal

@LongLiveCHIEF
Copy link

@dzello if this is an idea you'd like to see a working proposal on, let me know and I can see about creating a PR with a PoC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants