-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into bugfix-PR
- Loading branch information
Showing
37 changed files
with
414 additions
and
411 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
<!-- Matomo --> | ||
<script type="text/javascript"> | ||
var _paq = window._paq = window._paq || []; | ||
_paq.push(['trackPageView']); | ||
_paq.push(['enableLinkTracking']); | ||
(function() { | ||
<script> | ||
document.addEventListener('DOMContentLoaded', () => { | ||
var _paq = (window._paq = window._paq || []); | ||
_paq.push(['trackPageView']); | ||
_paq.push(['enableLinkTracking']); | ||
var u="//{{ site.analytics.matomo.domain }}/"; | ||
_paq.push(['setTrackerUrl', u+'matomo.php']); | ||
_paq.push(['setSiteId', {{ site.analytics.matomo.id }}]); | ||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; | ||
g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); | ||
})(); | ||
}); | ||
</script> | ||
<!-- End Matomo Code --> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,38 @@ | ||
<!-- https://utteranc.es/ --> | ||
<script | ||
src="https://utteranc.es/client.js" | ||
repo="{{ site.comments.utterances.repo }}" | ||
issue-term="{{ site.comments.utterances.issue_term }}" | ||
crossorigin="anonymous" | ||
async | ||
></script> | ||
|
||
<script type="text/javascript"> | ||
<script> | ||
(function () { | ||
const origin = 'https://utteranc.es'; | ||
const lightTheme = 'github-light'; | ||
const darkTheme = 'github-dark'; | ||
let initTheme = lightTheme; | ||
const html = document.documentElement; | ||
const themeMapper = Theme.getThemeMapper('github-light', 'github-dark'); | ||
const initTheme = themeMapper[Theme.visualState]; | ||
|
||
let script = document.createElement('script'); | ||
script.src = 'https://utteranc.es/client.js'; | ||
script.setAttribute('repo', '{{ site.comments.utterances.repo }}'); | ||
script.setAttribute('issue-term', '{{ site.comments.utterances.issue_term }}'); | ||
script.setAttribute('theme', initTheme); | ||
script.crossOrigin = 'anonymous'; | ||
script.async = true; | ||
|
||
if ( | ||
(html.hasAttribute('data-mode') && html.getAttribute('data-mode') === 'dark') || | ||
(!html.hasAttribute('data-mode') && window.matchMedia('(prefers-color-scheme: dark)').matches) | ||
) { | ||
initTheme = darkTheme; | ||
} | ||
const $footer = document.querySelector('footer'); | ||
$footer.insertAdjacentElement('beforebegin', script); | ||
|
||
addEventListener('message', (event) => { | ||
let theme; | ||
let newTheme; | ||
|
||
{%- comment -%} credit to <https://github.com/utterance/utterances/issues/170#issuecomment-594036347> {%- endcomment -%} | ||
if (event.origin === origin) { | ||
{%- comment -%} page initial {%- endcomment -%} | ||
theme = initTheme; | ||
} else if (event.source === window && event.data && event.data.direction === ModeToggle.ID) { | ||
{%- comment -%} global theme mode changed {%- endcomment -%} | ||
const mode = event.data.message; | ||
theme = mode === ModeToggle.DARK_MODE ? darkTheme : lightTheme; | ||
} else { | ||
return; | ||
} | ||
{%- comment -%} | ||
Credit to <https://github.com/utterance/utterances/issues/170#issuecomment-594036347> | ||
{%- endcomment -%} | ||
if (event.source === window && event.data && event.data.id === Theme.ID) { | ||
newTheme = themeMapper[Theme.visualState]; | ||
|
||
const message = { | ||
type: 'set-theme', | ||
theme: theme | ||
}; | ||
const message = { | ||
type: 'set-theme', | ||
theme: newTheme | ||
}; | ||
|
||
const utterances = document.getElementsByClassName('utterances-frame')[0].contentWindow; | ||
utterances.postMessage(message, origin); | ||
const utterances = document.querySelector('.utterances-frame').contentWindow; | ||
utterances.postMessage(message, origin); | ||
} | ||
}); | ||
})(); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.