I’m using hugo-book in my project. I have icons in headers on this page
But these headers appear without icons in table of contents. Inspecting html shows that in toc they have wrong link. E.g. “/images/bshift.png” instead of “/halflife-featureful/images/bshift.png”, i.e. they’re missing the prefix.
Here’s the markdown for this page.
I’m also using the render-image.html to override the one used by hugo book because it didn’t work with link prefix properly. Maybe I need to override something else to make images appear in the table of contents?
Change your content page to a leaf bundle. For example…
Content structure:
content/
├── posts/
│ ├── post-1/
│ │ ├── a.jpg
│ │ ├── b.jpg
│ │ └── index.md
│ └── _index.md
└── _index.md
Markdown:
##  Section 1
Veniam consequat ipsum proident do nostrud proident Lorem reprehenderit officia irure minim irure. Duis culpa labore elit do esse. Sunt nisi aute do reprehenderit. Adipisicing deserunt sint ut quis. Nisi non tempor mollit eiusmod qui proident ipsum laborum aliquip ullamco qui ut sint cupidatat.
##  Section 2
Exercitation id ipsum adipisicing eu esse voluptate. Ut aute deserunt aliqua deserunt labore ipsum. Ut nisi occaecat et adipisicing proident et amet proident aliqua in laborum aliqua voluptate. Qui consectetur occaecat reprehenderit velit ex officia eu amet. Id ipsum laborum ad eiusmod reprehenderit est.
Try it:
git clone --single-branch -b hugo-forum-topic-57446 https://github.com/jmooring/hugo-testing hugo-forum-topic-57446
cd hugo-forum-topic-57446
hugo server
As noted in this comment, the table of contents is created before the final render in order to support render hooks that call .TableOfContents.