Here’s an example site that includes a side bar menu generated by walking the content.
git clone --single-branch -b hugo-forum-topic-42835 https://github.com/jmooring/hugo-testing hugo-forum-topic-42835
cd hugo-forum-topic-42835
hugo server
Files of interest:
- layouts/partials/render-section-menu.html
- layouts/_default/baseof.html (lines 40-46; calls the partial)