From bb93fdfffabd31d6258c3994f873514cbcd31211 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Mon, 1 Aug 2022 19:05:38 -0400 Subject: [PATCH] replace hyvor with giscus --- assets/js/darkmode.js | 6 +++--- layouts/_default/single.html | 2 +- layouts/partials/comments.html | 18 ++++++++++++++++++ layouts/partials/hyvor.html | 9 --------- 4 files changed, 22 insertions(+), 13 deletions(-) create mode 100644 layouts/partials/comments.html delete mode 100644 layouts/partials/hyvor.html diff --git a/assets/js/darkmode.js b/assets/js/darkmode.js index 1daceb026..f69a3a738 100644 --- a/assets/js/darkmode.js +++ b/assets/js/darkmode.js @@ -1,6 +1,6 @@ -// const userPref = window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark' -const userPref = 'light' -const currentTheme = localStorage.getItem('theme') ?? userPref +const userPref = window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark' +// const currentTheme = localStorage.getItem('theme') ?? userPref +const currentTheme = userPref; if (currentTheme) { document.documentElement.setAttribute('saved-theme', currentTheme); diff --git a/layouts/_default/single.html b/layouts/_default/single.html index b7a32594e..3268c8d80 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -21,7 +21,7 @@ {{partial "textprocessing.html" . }} {{ if in .Page.RelPermalink "/posts/" }} - {{partial "hyvor.html" .}} + {{partial "comments.html" .}} {{ end }} {{partial "footer.html" .}} {{partial "popover.html" .}} diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html new file mode 100644 index 000000000..f62e1206b --- /dev/null +++ b/layouts/partials/comments.html @@ -0,0 +1,18 @@ +
+ +
\ No newline at end of file diff --git a/layouts/partials/hyvor.html b/layouts/partials/hyvor.html deleted file mode 100644 index 18f9093be..000000000 --- a/layouts/partials/hyvor.html +++ /dev/null @@ -1,9 +0,0 @@ -
- - \ No newline at end of file