mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-14 11:17:52 +08:00
_website: Fix placement of script (again).
This commit is contained in:
parent
7421828e1c
commit
adb2340aed
|
@ -68,6 +68,20 @@
|
|||
This snippet can be generated by contentIs("article").
|
||||
*/}}
|
||||
{{ template "content" . }}
|
||||
|
||||
<script>
|
||||
// If the domain starts with "dark.", trigger dark mode.
|
||||
if (location.hostname.startsWith('dark.')) {
|
||||
document.body.classList.add('dark');
|
||||
}
|
||||
|
||||
// Pressing d triggers dark mode. This is useful for debugging.
|
||||
window.addEventListener('keypress', function(ev) {
|
||||
if (String.fromCodePoint(ev.keyCode || ev.charCode) == 'd') {
|
||||
document.body.classList.toggle('dark');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
@ -112,18 +126,4 @@
|
|||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// If the domain starts with "dark.", trigger dark mode.
|
||||
if (location.hostname.startsWith('dark.')) {
|
||||
document.body.classList.add('dark');
|
||||
}
|
||||
|
||||
// Pressing d triggers dark mode. This is useful for debugging.
|
||||
window.addEventListener('keypress', function(ev) {
|
||||
if (String.fromCodePoint(ev.keyCode || ev.charCode) == 'd') {
|
||||
document.body.classList.toggle('dark');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{{ end }}
|
||||
|
|
Loading…
Reference in New Issue
Block a user