Skip to content

Commit

Permalink
chore: remove comments from compressed HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
cotes2020 committed Apr 20, 2024
1 parent 662cd33 commit 63c5138
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions _includes/mode-toggle.html
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -51,7 +51,7 @@

self.notify();
});
} /* constructor() */
} {%- comment -%} constructor() {%- endcomment -%}

get sysDarkPrefers() {
return window.matchMedia('(prefers-color-scheme: dark)');
Expand All @@ -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;
Expand All @@ -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(
{
Expand Down Expand Up @@ -136,8 +138,8 @@
}

this.notify();
} /* flipMode() */
} /* ModeToggle */
}
}

const modeToggle = new ModeToggle();
</script>
2 changes: 1 addition & 1 deletion _includes/search-loader.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h2><a href="{url}">{title}</a></h2>
{% capture not_found %}<p class="mt-5">{{ site.data.locales[include.lang].search.no_results }}</p>{% endcapture %}

<script>
/* Note: dependent library will be loaded in `js-selector.html` */
{%- comment -%} Note: dependent library will be loaded in `js-selector.html` {%- endcomment -%}
SimpleJekyllSearch({
searchInput: document.getElementById('search-input'),
resultsContainer: document.getElementById('search-results'),
Expand Down

0 comments on commit 63c5138

Please sign in to comment.