I am trying to render out a generated table of contents for this specific page using a partial. I feed it a dictionary of shape map[string]interface{} and tell it to execute based on that. For some reason, though, it renders very inconsistently; when I do a fresh hugo serve it does not render the range loop of the map, despite getting the proper data (verified using debug.Dump), but when saving the partial’s file page, it renders correctly.. On our CI deployment, it does not render at all.
View Lua API Reference – Recoil Engine to see my work in progress branch. On the right is a table of contents that currently has dumped data passed to it. It is supposed to render the items in a list above the dumped docs.
As for why you can’t see anything and why the site is weird for you, it’s because you are surely cloning the master branch. I am working on site_formatting_template as I linked, although I understand missing that detail, and I should have mentioned that in the original post. My bad.
I updated the Hugo version both on my computer and in CI to be the latest released as of writing (I think). Note that this repository is a game engine, and that the item of interest is the doc folder. Again, I did not indicate that. None of the submodules are necessary to build the site. The theme is expected to be vendored, though.
One thing I will also mention is that there is a readme for building the website with all of the data automatically populated. I will not force you to do that. Here is a heavily truncated version of the API docs it needs, since the page in question is the docs page. Place this json file as doc.json in the data folder. doc.json - Pastebin.com
I apologize for missing information in my earlier post. I posted it late at night in exasperation, and didn’t think it through.
that one Base, but it does not apply to yours (as far as I researched)
regarding go-mod update:
old hextra was 0.9.7 with old layout structure of 0.145
new would be 11+ with new layout structure and some other changes and it won’t build
you have a lot of stuff in your cache that’s magically taken over, so it’s a good idea to clean that up and do fresh clones maybe add cacheDir to localize …
reverted to hextra 0.9.7:
toc-subheading definition.
you define a template in a partial but not as inline => this results in your defined one is not found at the first build.
if you change the commented call and definition to inline , “IN TOC” is also printed but fails due to the content of the variables. → guess you will have to fix up some code here
if you change the loop inside toc-subheading to that one you will get some output to the sidebar
{{ range . }}
<li><a class="margin-left-1rem" href="#oops"> {{ . }}</a></li>
{{ end }}
Wait, hang on, so I don’t 100% understand what’s going on here. It’s still in the same file, but defined under a path as a partial, and somehow that works? Is the inline path special?