Slow code highlighting

Hello! I am new to hugo and website making. I am trying to use highlightjs to highlight some code and it works, that is the good part. The bad is it takes forever to do that. When I am on my computer and run the hugo server, it is blazing fast. Nevertheless, when I push stuff to github and open my website, the highlighting takes a couple minutes to actually happen.

I am using purehugo theme (hugo server --theme=purehugo -D --watch)
The whole hugo project is available at . I saved highlight.js files in css and js folders. I added some code to the layout/partials/header.html file in theme folder. I am new to javascript as well… I tried a couple different order of commands… all have worked but all are slow when retrieving from the server.

You can open and see for yourself that it takes some time for the LaTeX code in the page to be highlighted. At least here in Brazil it does… I tried on more than one computer, a couple browsers and more than one internet connection.

Anyone had a similar issue?

Your problem isn’t code highlighting, but the livereload reference.

You must rebuild the site with hugo (as in: not hugo server -w) before pushing to Github (or/and, like me, keep dev and production destinations totally separate).


Hi, thank you very much! Now it works fine! I keep the dev and productions destinations separate, but I was copying the folder compiled with hugo server -w to the production destination.