keep dark mode inside the (site.enable_darkmode) conditional (#3233)

Hi,
I noticed some weird behavior when I turned dark mode off (some of the
text seemed to disappear, it became white :) )

I traced it to: {% if site.enable_darkmode %} in head.liquid
where some darkmode features are place before the if statement.

When putting it inside the if statement then the weird behavior was
solved; see the pull request here :)

Cheers,
Jan
This commit is contained in:
Jan van Gemert 2025-07-21 16:27:21 +02:00 committed by GitHub
parent 9cda66f54e
commit a7f486fa7a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -69,9 +69,9 @@
<link rel="stylesheet" href="{{ '/assets/css/main.css' | relative_url | bust_css_cache }}">
<link rel="canonical" href="{{ page.url | replace:'index.html','' | absolute_url }}">
<!-- Dark Mode -->
<script src="{{ '/assets/js/theme.js' | relative_url | bust_file_cache }}"></script>
{% if site.enable_darkmode %}
<!-- Dark Mode -->
<script src="{{ '/assets/js/theme.js' | relative_url | bust_file_cache }}"></script>
<link
defer
rel="stylesheet"