1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 05:41:31 +00:00

chore: remove comments from compressed HTML

This commit is contained in:
Cotes Chung
2024-04-20 23:59:59 +08:00
parent 662cd331e3
commit 63c51384df
2 changed files with 9 additions and 7 deletions

View File

@@ -33,7 +33,7 @@
let self = this;
/* always follow the system prefers */
{%- comment -%} always follow the system prefers {%- endcomment -%}
this.sysDarkPrefers.addEventListener('change', () => {
if (self.hasMode) {
if (self.isDarkMode) {
@@ -51,7 +51,7 @@
self.notify();
});
} /* constructor() */
} {%- comment -%} constructor() {%- endcomment -%}
get sysDarkPrefers() {
return window.matchMedia('(prefers-color-scheme: dark)');
@@ -77,7 +77,7 @@
return sessionStorage.getItem(ModeToggle.MODE_KEY);
}
/* get the current mode on screen */
{%- comment -%} get the current mode on screen {%- endcomment -%}
get modeStatus() {
if (this.isDarkMode || (!this.hasMode && this.isSysDarkPrefer)) {
return ModeToggle.DARK_MODE;
@@ -101,7 +101,9 @@
sessionStorage.removeItem(ModeToggle.MODE_KEY);
}
/* Notify another plugins that the theme mode has changed */
{%- comment -%}
Notify another plugins that the theme mode has changed
{%- endcomment -%}
notify() {
window.postMessage(
{
@@ -136,8 +138,8 @@
}
this.notify();
} /* flipMode() */
} /* ModeToggle */
}
}
const modeToggle = new ModeToggle();
</script>