Background
I applied a fix to Hugo’s ToC ten days ago.
Drawbacks
To make the script non-render blocking, one has to place it in the footer.
As a result, it takes about 0.2 seconds to remove the excess <ul>
tag.
Solution
Thanks to Beej126’s Hugo template code, this site delivers table of contents processed by Hugo during GitLab’s continuous deployment.