blob: a60011f66b5206e0e0875d0580a666d3ee3cc0eb (
plain)
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
|
<!-- Lazyload support -->
<% if (theme.lazyload) { %>
<script defer src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.min.js"></script>
<script>
window.lazyLoadOptions = {
elements_selector: ".lazy",
threshold: 0,
effect: "fadeIn"
};
</script>
<% } %>
<!-- Darkmode support -->
<link rel="stylesheet" type="text/css" href="https://unpkg.com/bulma-prefers-dark" />
<%- js('js/darkmode.js') %>
<script>
var darklistener = new DarkmodeListener();
</script>
<!-- Highlight.js support -->
<% if (theme.highlight.enable === true) { %>
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/highlight.pack.min.js"></script>
<link id="highlight-light-theme" rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/styles/<%= theme.highlight.lightmode %>.min.css">
<link id="highlight-dark-theme" rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/styles/<%= theme.highlight.darkmode %>.min.css">
<script>
const theme_selector = (mode) => {
if (mode === SystemDarkmodePrefrence.dark) {
document.getElementById("highlight-light-theme").setAttribute("disabled", "disabled");
document.getElementById("highlight-dark-theme").removeAttribute("disabled");
} else {
document.getElementById("highlight-dark-theme").setAttribute("disabled", "disabled");
document.getElementById("highlight-light-theme").removeAttribute("disabled");
}
};
theme_selector(darklistener.mode());
darklistener.add(theme_selector);
hljs.initHighlightingOnLoad();
</script>
<% } %>
<!-- Shikwasa Player support -->
<% if (is_post() && theme.podcast && page.podcast) { %>
<script defer src="https://cdn.jsdelivr.net/npm/shikwasa/dist/shikwasa.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/shikwasa/dist/shikwasa.min.css">
<% } %>
|