mirror of https://github.com/luizdepra/hugo-coder.git

Muqeet Malik
18.44.2024 3afaa3f1b890d368f635cffb2cf8faada12389e1
refs
author Muqeet Malik <muqeetamalik@gmail.com>
Thursday, January 18, 2024 00:44 +0100
committer GitHub <noreply@github.com>
Thursday, January 18, 2024 00:44 +0100
commit3afaa3f1b890d368f635cffb2cf8faada12389e1
tree dd34e192d8bceb924130346aeeaf3c4d4fee4b88 tree | zip | gz
parent 0fab52d36def70f46847787ec755837313f51feb view | diff
Allow users to disable default theme-switching Javascript files (#870)

### Prerequisites

Put an `x` into the box(es) that apply:

- [ ] This pull request fixes a bug.
- [x] This pull request adds a feature.
- [ ] This pull request introduces breaking change.

### Description

This PR enables users to use the theme independently of JavaScript,
requiring only minimal changes. I've introduced a
`disableDefaultJsScripts` flag, rather than a `disableJS` toggle, to
avoid implying zero JavaScript. This approach keeps separately
configured JavaScript features like comments and analytics functional,
ensuring they are logically consistent with the
`disableDefaultJsScripts` configuration.

Moreover, when disableDefaultJsScripts is enabled, hideColorSchemeToggle
must be set to true, or else the app will fail with an error message. I
felt that this is a misconfiguration and alerting the user would provide
a better overall user experience ( I would not want somebody spending
time trying to figure out why the theme is not switching)

### Issues Resolved

#831

### Checklist

Put an `x` into the box(es) that apply:

#### General

- [x] Describe what changes are being made
- [x] Explain why and how the changes were necessary and implemented
respectively
- [x] Reference issue with `#<ISSUE_NO>` if applicable

#### Resources

- [ ] If you have changed any SCSS code, run `make release` to
regenerate all CSS files

#### Contributors

- [ ] Add yourself to `CONTRIBUTORS.md` if you aren't on it already

---------

Co-authored-by: Muqeet Malik <muqeet.malik.-nd@disneystreaming.com>
2 files modified
13 ■■■■■ changed files
docs/configurations.md 7 ●●●●● diff | view | raw | blame | history
layouts/_default/baseof.html 6 ●●●● diff | view | raw | blame | history