Quantcast
Channel: Sections wrapped in a shortcode do not appear in the TOC
Viewing all articles
Browse latest Browse all 15

Sections wrapped in a shortcode do not appear in the TOC

$
0
0

@StarfallProjects wrote:

Hi! I am having an issue with .TableOfContents

On a normal page, it generates fine - picks up my <h1> (not ideal but not a big problem) and <h2>

However, I have started using shortcodes to add custom styling around some sections. A typical file might look like this:

# Main heading

## Some content

blah blah blah

{{< gimme-a-border >}}

## More content

blah blah blah

{{< /gimme-a-border >}}

## Yet more content

blah blah blah

“Main heading”, “Some content” and “Yet more content” all appear in the TOC. “More content” does not.

This is the code for the nav with the TOC in:



{{ .TableOfContents }}
Download page as PDF

This is the code for the shortcodes:

<div class="docs-insight-tier">
    <strong style=
    "background-color: rgba(255, 185, 199, 1); 
    padding: 0.3rem;
    margin-left: -6px;
    border-radius: 0 0.25rem 0.25rem 0; 
    border: 0.25rem solid rgba(255, 185, 199, 1);"
    >Insight and above</strong>
    {{ .Inner | markdownify }}
</div>

Read full topic


Viewing all articles
Browse latest Browse all 15

Trending Articles