jpescador / hugo-future-imperfect

A ported theme with some extras for the Hugo static website engine
MIT License
311 stars 228 forks source link

Disabling hightlight.js #131

Open rowing-matters opened 6 years ago

rowing-matters commented 6 years ago

Expected Behavior

I tried to disable highlight.js. Hence I set disable_highlight = true in config.toml. But it doesn't seem to work. I expect, that the highlight.min.js is not reference in generated html.

Current Behavior

But it doesn't seem to work. I still see `

[...]

` in the generated code. ## Possible Solution I guess, there's an error in line 11 of layouts/partials/footer.html: > {{ if (not .Params.disable_highlight) }} should be > {{ if (not .Site.Params.disable_highlight) }}` But if i correct this, I get an error "hljs is not defined". I guess the reason is line 1173 of footer.html. This should only be done "if not .Site.Params.disable_highlight". ## Your Environment **Hugo Version:** Hugo Static Site Generator v0.36 linux/amd64 BuildDate: 2018-02-05T15:22:28Z **Browser:** Firefox 59.0.1 **Desktop or Mobile:** Desktop
pacollins commented 6 years ago

@Jean85 made the change last time. Hopefully they can check this out.

Jean85 commented 6 years ago

Yes, I fixed one thing about it in #116. @rowing-matters can you check if you're using a version of the theme that includes that fix?

rowing-matters commented 6 years ago

Hi, I'm on head of master. I get an identical index.html - no matter if disable_highlight is en- or disabled in config.toml.

I'm not an expert. But I think it's quite obvious, that in line 11 of footer.html the reference of the parameter is wrong.

Cheers!

pacollins commented 6 years ago

Thanks for reporting this. I am actually doubling back over the entire theme to re-base the code to be more semantic and less cluttered (in addition to utilizing CSS Grid for a more responsive layout). This is on the list.

🥂

Colin-Parente commented 4 years ago

I'm guessing you wanted to disable it because of its cdn being from cdnboot (super slow). One way around, which I ended up doing, was changing the cdn host to cloudflare. That boosted the sites loading time from 9 seconds to 1.3