diff options
-rw-r--r-- | data/eureka.yaml | 2 | ||||
-rw-r--r-- | layouts/partials/comment/utterances.html | 12 | ||||
-rw-r--r-- | package.json | 2 |
3 files changed, 11 insertions, 5 deletions
diff --git a/data/eureka.yaml b/data/eureka.yaml index 986f7e6..bbbc8e1 100644 --- a/data/eureka.yaml +++ b/data/eureka.yaml @@ -1 +1 @@ -version: 0.8.1
\ No newline at end of file +version: 0.8.2-dev
\ No newline at end of file diff --git a/layouts/partials/comment/utterances.html b/layouts/partials/comment/utterances.html index e2f0471..56e632c 100644 --- a/layouts/partials/comment/utterances.html +++ b/layouts/partials/comment/utterances.html @@ -17,15 +17,21 @@ </script> <script> {{- if eq .Site.Params.colorScheme "light" }} - if ((storageColorScheme == 'Auto' && window.matchMedia("(prefers-color-scheme: dark)").matches) || storageColorScheme == "Dark") { + if (storageColorScheme == "Auto") { + document.getElementById('utterances').setAttribute('theme', 'preferred-color-scheme') + } else if (storageColorScheme == "Dark") { document.getElementById('utterances').setAttribute('theme', 'github-dark') } {{- else if eq .Site.Params.colorScheme "dark" }} - if ((storageColorScheme == 'Auto' && window.matchMedia("(prefers-color-scheme: light)").matches) || storageColorScheme == "Light") { + if (storageColorScheme == "Auto") { + document.getElementById('utterances').setAttribute('theme', 'preferred-color-scheme') + } else if (storageColorScheme == "Light") { document.getElementById('utterances').setAttribute('theme', 'github-light') } {{- else }} - if (((storageColorScheme == 'Auto' || storageColorScheme == null) && window.matchMedia("(prefers-color-scheme: dark)").matches) || storageColorScheme == "Dark") { + if (storageColorScheme == "Light") { + document.getElementById('utterances').setAttribute('theme', 'github-light') + } else if (storageColorScheme == "Dark") { document.getElementById('utterances').setAttribute('theme', 'github-dark') } {{- end }} diff --git a/package.json b/package.json index 3857f8d..14fc927 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hugo-eureka", - "version": "0.8.1", + "version": "0.8.2-dev", "description": "Eureka is a feature-rich and highly customizable Hugo theme.", "repository": "https://github.com/wangchucheng/hugo-eureka", "author": "C. Wang <me@wangchucheng.com>", |