File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
src/resources/formats/html Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 13
13
<%- giscus.loading ? `data-loading =${giscus.loading} ` : ' ' % >
14
14
async >
15
15
</script >
16
+ <script type =" application/javascript" >
17
+ window .document .addEventListener (" DOMContentLoaded" , function (event ) {
18
+ var giscusIframe = window .document .querySelector (' iframe.giscus-frame' );
19
+ giscusIframe .addEventListener (" load" , function () {
20
+ window .setTimeout (() => {
21
+ window .toggleGiscusIfUsed (window .hasAlternateSentinel (), authorPrefersDark);
22
+ }, 100 );
23
+ });
24
+ });
25
+ </script >
16
26
<input type =" hidden" id =" giscus-base-theme" value =" <%- giscus.baseTheme %>" >
17
27
<input type =" hidden" id =" giscus-alt-theme" value =" <%- giscus.altTheme %>" >
Original file line number Diff line number Diff line change 188
188
toggleGiscusIfUsed (toAlternate, darkModeDefault);
189
189
};
190
190
191
+ window .toggleGiscusIfUsed = toggleGiscusIfUsed;
192
+
191
193
< % if (respectUserColorScheme) { % >
192
194
queryPrefersDark .addEventListener (" change" , e => {
193
195
if (window .localStorage .getItem (" quarto-color-scheme" ) !== null )
You can’t perform that action at this time.
0 commit comments