-
I have created a file called ---
Layout: _DocsLayout
---
# Title
Some text
## Section 1
Section 1 text
## Section 2
Section 2 text In the _DocsLayout page, I specify a sidebar which holds this content: @{
var headings = Document.GetDocumentList(Statiq.Html.HtmlKeys.Headings);
}
@* snip *@
<div class="box">
<ul>
@foreach (IDocument heading in headings)
{
<li>@(await heading.GetContentStringAsync())</li>
<ul>
@{
var documentListCount = heading.GetDocumentList(Statiq.Html.HtmlKeys.Headings).Count;
var childCount = heading.GetChildren().Count;
<li>Document List Count: @documentListCount</li>
<li>Child Count: @childCount</li>
}
</ul>
}
</ul>
</div> When I render this page, the box appears as this: It seems the engine correctly identifies Edit: I have manually pushed to GitHub Pages if you wish to see an example: https://luzfaltex.github.io/policies/terms |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Found the fix for this. In my settings, set |
Beta Was this translation helpful? Give feedback.
Found the fix for this. In my settings, set
GatherHeadingsLevel
to how many layers deep you want. In my case, I chose 3. It now detects child headings properly on all Markdown pages. On HTML pages, it does not appear to detect any headings, so I may need to do some tinkering here.