-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No JavaScript regression (BookEnableJS option) #90
Comments
Hi! The reason why I removed Also 2 shortcodes were introduced that use JS: So at that point I decided to remove |
Hmm, I see there's a lack of clarity on the option, too. In my opinion, there are two different ways to achieve this:
I did a proof-of-concept implementation here. Maybe things could be easier to understand and use if all feature flags were negative, since not specifying them won't disable anything. That way we can avoid the
What do you think? |
Sorry for late reply, I have read your comment some time ago and gave some time to thought it I think generic
that can be emptied with Though, there is now only one feature that will stay there, which is scroll reset.
Also perhaps this list can be extended https://gohugo.io/about/hugo-and-gdpr/#all-privacy-settings |
I think to add |
Yes! That would work perfectly, 🤗 Thank you so much for your work, and excuse my absence! (This issue can be closed when 6877700 reaches |
Hi! have script in And add this to partial template. {{ $script := resources.Get "menu-reset.js" | resources.Minify }}
{{ with $script.Content }}
<script>{{ . | safeJS }}</script>
{{ end }} So in order to disable it you will overwrite |
Hmm! That's a pretty clever idea, certainly! I didn't knew about the Maybe group script assets in a |
Hi! Because it is important to you please keep an eye on these files, in case if new added. I will try to not break it without reason. |
Great! I'll test this sortly and close this issue as solved accordingly. Thank you so much again for your consideration and caring, Alex. |
Hi! |
@Roboe Hi there! |
Hey, Alex! Thank you for the notification! Thanks again for your consideration! |
Commit dda0a0e introduced a new JS-based search and, at the same time, removed the
BookEnableJS
option, which wasfalse
by default.In configs with explicit
BookEnableJS = false
, this introduced a regression which makes it load JS scripts without the awareness of the site owner (for the search and for the menu scroll).Since Hugo Books was one of the few pretty and made-with-care JS-free themes for Hugo, is there a possibility to restore that functionality for site owners not wanting any JavaScript at all?
I can look into it and prepare a PR (edit: look at the progress here). If I'm not mistaken, there are only three scripts: one for the scrolling menu, one for the search widget, and one for Google Analytics (if
googleAnalytics
option is set).The text was updated successfully, but these errors were encountered: