-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathdefault.html
executable file
·92 lines (70 loc) · 2.66 KB
/
default.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
---
layout: compress
---
<!DOCTYPE html>
<html lang="en">
{% include head.html %}
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-3EP7KLCYVP"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-3EP7KLCYVP');
</script>
<body>
<main>
{% include anchor_headings.html html=content anchorBody="#" %}
</main>
<script>
function setTheme(theme) {
if (theme === "dark") {
document.documentElement.setAttribute('data-theme', 'dark');
window.localStorage.setItem('theme', 'dark');
document.getElementById("theme-toggle").classList.add('sun');
document.getElementById("theme-toggle").classList.remove('moon');
} else {
document.documentElement.setAttribute('data-theme', 'light');
window.localStorage.setItem('theme', 'light');
document.getElementById("theme-toggle").classList.add('moon');
document.getElementById("theme-toggle").classList.remove('sun');
}
}
let theme = localStorage.getItem('theme');
theme = theme || (window.matchMedia ? window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light' : 'light');
setTheme(theme);
function modeSwitcher() {
let currentMode = document.documentElement.getAttribute('data-theme');
if (currentMode === "dark") {
setTheme('light');
} else {
setTheme('dark');
}
}
</script>
</body>
<footer class="social-footer">
<div class="social-footer-icons">
<a href="https://github.com/P0WEX" title="Github profile, nothing much there, yet" target="_blank"
rel="noopener noreferrer"><i class="fa fa-github" aria-hidden="true"></i></a>
<a href="{{site.url}}/atom.xml" title="Feed RSS" target="_blank" rel="noopener noreferrer"><i
class="fa fa-rss" aria-hidden="true"></i></a>
<a href="https://github.com/P0WEX/Gesko" title="Browse the code" target="_blank" rel="noopener noreferrer"><i
class="fa fa-code" aria-hidden="true"></i></a>
</div>
</footer>
{% if page.url == '/' %}
<script src="{{ site.baseurl }}/assets/js/simple-jekyll-search.js"></script>
<script>
var sjs = SimpleJekyllSearch({
searchInput: document.getElementById('search-input'),
resultsContainer: document.getElementById('search-results'),
json: '{{ site.baseurl }}/search.json',
searchResultTemplate: '<li><a href="{url}" title="{desc}">{title}</a></li>',
noResultsText: 'No results found..',
limit: 10,
fuzzy: true,
})
</script>
{% endif %}
</html>