I am using the Docsy theme and the readfile shortcode to include markdown files on other pages. I noticed that the right-hand nav is not showing any of the headings that are part of the file that I am including. It only shows headers for content that was already on the page.
I saw that this issue was reported in the past, but could not find a solution to this issue. Is there a way to get the nav populated?
With the {{% %}} notation, the shortcode expects to receive markdown, and fully renders the shortcode before the rest of the page is rendered. So if the markdown received contains headings, those headings will be included in the TOC.
The markdown is passed through .Page.RenderString, rendering it to HTML, then it is rendered to HTML again due to the {{% %}} notation. So the headings will not be included in the TOC because they were already rendered to HTML.
sorry I just noticed one thing. I was using other shortcodes (conditional-text) in the markdown file that I am including with the readfile shortcode. these shortcodes are not rendering anymore with the new approach. is there a way that I can make them render as well?
Thank you so much. I tried out the TOC partial approach and I can now render the page and see a right-hand nav. But I cannot get the individual nav entries to be listed underneath. It currently looks like this
git clone --single-branch -b hugo-forum-topic-42343 https://github.com/jmooring/hugo-testing hugo-forum-topic-42343
cd hugo-forum-topic-42343
hugo server