Using TOC in article breaks link in home page #23
It should work if you replace
and it also looks a bit better (my opinion). This is no real fix, but let me know whether this fixes your problem.
PS: I would add a bit CSS from Sphinx to style the contents directive a bit, you can look for example into the dark theme: