Jieiku / abridge

Fast & Lightweight Zola Theme
https://abridge.pages.dev/
MIT License
142 stars 41 forks source link

Fix: Always load `nojs.css` irrespective of `build_search_index` setting #131

Closed welpo closed 11 months ago

welpo commented 11 months ago

Currently, the nojs.css file is only loaded when config.build_search_index returns false. This file is responsible for hiding JavaScript elements when JavaScript is disabled in the user's browser.

In practice, this means JavaScript elements like the theme switcher button or the encoded email (in the socials section) are mistakenly visible when JavaScript is disabled, as long as build_search_index is not set to true in config.toml. This is contrary to the expected behavior where these elements should be hidden when JavaScript is disabled, irrespective of the build_search_index setting.

This PR fixes this issue by removing the conditional, effectively ensuring that the nojs.css file is always loaded when JavaScript is disabled. This change aligns the behavior with the intended functionality of hiding specific JavaScript-dependent elements when JavaScript is not enabled.

netlify[bot] commented 11 months ago

Deploy Preview for abridge ready!

Name Link
Latest commit 0c0c0e18de8c0db6a9f470fc5b85b367d588f2f1
Latest deploy log https://app.netlify.com/sites/abridge/deploys/64cad8a2f7dea30008bd5897
Deploy Preview https://deploy-preview-131--abridge.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Jieiku commented 11 months ago

ah another relic of the past, at one point there was only a couple of js features, and I think I only hid the js search initially.

Thanks for spotting this, appreciate it.

welpo commented 11 months ago

Understandable! I was working on hiding the theme switcher button on my theme, and at first I made it hide by default but become visible with the theme switcher js.

I decided to check out how you did it with abridge and I liked the idea of making it more versatile for possible future additions. So I copied your way of doing it (https://github.com/welpo/tabi/commit/113a7f4e5d4efd87646f8c26f81b7754ea7f41e2) and noticed the issue with build_search_index.