McShelby / hugo-theme-relearn

A theme for Hugo designed for documentation
https://mcshelby.github.io/hugo-theme-relearn/
MIT License
433 stars 187 forks source link

include: don't erroneously remove headings if `hidefirstheading=true` #914

Closed McShelby closed 2 months ago

McShelby commented 2 months ago
# Titel

## Heading

Text

### Subheading

Some more text

Heading will be erroneously removed using hidefirstheading=true

postb99 commented 2 months ago

Ah, I understand better why I didn't see included pages' titles and this bugged me. Will update and enjoy.

McShelby commented 2 months ago

Just to be clear: If you want to include the file unmodified, just omit the second parameter.

https://mcshelby.github.io/hugo-theme-relearn/shortcodes/include/index.html

postb99 commented 2 months ago

Well, there is something I still don't understand. I omit parameter yet but neither the title nor a # or ## heading shows up when the page is included. In my case it's a cascading inclusion like this:

Main page: https://github.com/poesieland/poesieland.github.io/blob/7c71980cae32a4c8d9dcb94eece99942b14d95c9/content/fr/_index.md?plain=1#L8-L10

First inclusion: https://github.com/poesieland/poesieland.github.io/blob/ba387b39631ff5bbf243452d869265774b25eea1/content/fr/includes/last_thought.md?plain=1#L2-L4

Included file: https://github.com/poesieland/poesieland.github.io/blob/main/content/fr/thoughts/20240911.md?plain=1

In this last file, I tried adding a # or ## or ### heading but nothing shows on main page. Do you have time to play with it?

McShelby commented 2 months ago

Hi Barbara! In https://github.com/poesieland/poesieland.github.io/blob/7c71980cae32a4c8d9dcb94eece99942b14d95c9/content/fr/_index.md?plain=1#L8-L10 you are still calling the include shortcode with the second parameter. If you remove that, you should see all headings.