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
No known key found for this signature in database
GPG key ID: 0D9E54843167A808
2 changed files with 9 additions and 7 deletions

View file

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

View file

@ -19,7 +19,7 @@
{% capture not_found %}<p class="mt-5">{{ site.data.locales[include.lang].search.no_results }}</p>{% endcapture %} {% capture not_found %}<p class="mt-5">{{ site.data.locales[include.lang].search.no_results }}</p>{% endcapture %}
<script> <script>
/* Note: dependent library will be loaded in `js-selector.html` */ {%- comment -%} Note: dependent library will be loaded in `js-selector.html` {%- endcomment -%}
SimpleJekyllSearch({ SimpleJekyllSearch({
searchInput: document.getElementById('search-input'), searchInput: document.getElementById('search-input'),
resultsContainer: document.getElementById('search-results'), resultsContainer: document.getElementById('search-results'),