Jquery not working? Potential solution

I spent too long trying to figure out why my jquery wasn’t finding what it was looking for.
For instance, a scroll to top animation - which finds hrefs with anchors, matching IDs in the DOM and animates to them - or Bootstrap’s scrollspy, weren’t working.
Enter: PartialIDAnchors.

Adding the following to your config.toml may help. The JQuery things didn’t like that the anchors had a colon in the middle. I was using {{ TableOfContents }} to generate the menu, so couldn’t easily change that.

  plainIDAnchors = true

Makes the header URLs be the header text.
Warning: Don’t use the same header words twice in the instance where the JQuery selectors are in action.

Which is the default setting in 0.16.

This wasn’t the case for me, using Hugo 0.16 (-DEV 2016-02-06)

In Hugo 0.16 RELEASE version, you are on a fairly old Dev version.

1 Like

Odd - Ubuntu’s repository is still treating v0.15+git20160206.203.ed23711-1 as the latest available version.
Upgraded now, but that point might be worth noting.