Dark mode switch doesn’t do anything

Describe the bug

Dark mode switch doesn’t do anything and is stuck on old mode (no dropdown menu)

To Reproduce

Steps to reproduce the behavior:

Go to nriaziat.netlify.com Click on the theme toggle See error Expected behavior

Dropdown menu should appear and give theme mode options. At the very least, mode should switch on click.

Technical details:

Academic Version: 4.9 (dont know how to check) Hugo Version: 0.68.3 Browser/OS: Chrome on Windows 10

Hi Nzriaziat, welcome to the forum! :wave:

The theme toggle neither works on my end. If I click on it, an error message appears in the browser’s console window:

jquery.min.js:2 Uncaught Error: Syntax error, unrecognized expression: [name=]
    at Function.se.error (jquery.min.js:2)
    at se.tokenize (jquery.min.js:2)
    at se.select (jquery.min.js:2)
    at Function.se [as find] (jquery.min.js:2)
    at k.fn.init.find (jquery.min.js:2)
    at new k.fn.init (jquery.min.js:2)
    at k (jquery.min.js:2)
    at HTMLAnchorElement.<anonymous> (academia.min.281fa180ccfa1769ea3c7dd430814861.js:11)
    at HTMLAnchorElement.dispatch (jquery.min.js:2)
    at HTMLAnchorElement.v.handle (jquery.min.js:2)

I don’t know how to fix this error since it looks to be caused by your theme. Or if it’s not caused by the Academic theme, then it’s a JavaScript programming error. Either way it’s not something Hugo did.

But perhaps there are Hugo users that also use your specific theme and can help more. :slightly_smiling_face:


Edit: Since the creator of the theme pointed you in the GitHub issue to this forum, you might have expected more help from here. And I fully get that. But most of us here on the forum don’t use the Academic theme.

I just wanted to clarify that just in case you and other readers otherwise get a bad impression. :slight_smile: