update dark and light mode

This commit is contained in:
2025-08-06 12:31:49 +03:00
parent 01b2327dc0
commit b2a1660aa3
5 changed files with 89 additions and 3 deletions

View File

@@ -5,6 +5,18 @@
{% set zolaVer = '0.13.0' %}
<head>
<script>
(function() {
try {
var theme = localStorage.getItem('theme');
if (theme === 'dark' || (!theme && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
document.documentElement.classList.add('dark');
} else {
document.documentElement.classList.remove('dark');
}
} catch (e) {}
})();
</script>
<meta name="generator" content="Zola v.{{ zolaVer }} - getzola.org" />
<link rel="icon" type="image/x-icon" href="{{ get_url(path='images/favicon.png')}}">
{% block title %}