Hugo Docs Theme (theme used for Documentation site for Hugo) expando doesn't work when uploaded to github/netlify. Works fine locally

I’ve been using the Hugo ‘official’ documentation theme for a while now. The menus on the left open fine when I run hugo server -D locally and when I uploaded them to github/netlify. But just yesterday, when I generated the files using the Hugo command and uploaded the generated files to github, none of the menus on the left open up. I’ve tried this on Netlify too. The files are generated fine and the site works but the menus on the left just refuse to open up. Anyone here care to share on what I might be doing wrong here.
Link to my test site btw: https://writarium.github.io/

Local machine - Expando works

After uploading to github/netlify - Expando stops working

expando-not-working

Link to my test site (again): https://writarium.github.io/
Notice that none of the menus are expanding or collapsing. When you click the menus on the header, the links work fine and the parent menu expands.

Javascript I’m told is a client browser issue and not a server one. But I don’t think that’s the case here. It was working just fine, like 8 hours ago when I last generated the site using the Hugo command and uploaded them to github. Now they just refuse to open up.

You’re thinking in the right direction with your last paragraph about Javascript.

30%20pm

I opened up the Web Console in firefox on your site and got this error.

I’d be looking at whether the assets are being updated correctly when you deploy to netlify or gitlab. Running hugo with the --gc switch might help. And on Netlify, make sure that you aren’t using their tools to minify or modify your JS assets in any way, because that breaks the checksum (I don’t know if GitHub Pages does anything like that).

1 Like

Thank you @funkydan2 for the reply.

I’d be looking at whether the assets are being updated correctly when you deploy to netlify or gitlab.

How do I do that? I mean, what assets? Sorry but I don’t know what that means :slight_smile:

Running hugo with the --gc switch might help.

Tried this Hugo --gc , uploaded all the generated files again but no luck > https://writarium.github.io/ :expressionless:

@funkydan2, sorry to disturb you again. But it seems the assets folder isn’t being created at all when I run hugo --gc (or hugo for that matter).

There does exist an assets folder which has js and css files in the source folder. Any idea on where do I place this in the generated site’s folder? The root folder?

Ok. So I directly uploaded the generated files directly to github manually and WOW! the site is working fine.

@funkydan2 (or anyone), any idea what the reason might be? I’m using the following git command (sorry going off topic and moving to git Qs but asking in case someone might have an answer. I’ve tried git add * too but no luck.

git init
git status
git add .
git commit -m "First commit"
git status
git remote add origin https://github.com/writarium/writarium.github.io.git
git push -u origin master

Are you doing all those commands each time you make changes to your site? Once git is setup I think you just need to

git add .
git commit -m "My commit message"
git push

Though I find using git through a GUI much easier - I either use the one built into atom or Sourcetree

1 Like

Yeah @funkydan2. My process usually is :frowning:

  1. Generate the site using Hugo
  2. Go to the public folder, do the following
git add .
git commit -m "My commit message"
git push
  1. Rinse and repeat every time I generate the site.

Because of all the mess that made me create this thread, I gave GitHub Desktop a go last night and it seems to be much streamlined and easier.

Those commands should have worked, but I reckon stick with the GUI.

1 Like