mirror of
https://github.com/interstellar750/hexo_s
synced 2024-10-18 16:23:50 +08:00
36 lines
1.1 KiB
Plaintext
36 lines
1.1 KiB
Plaintext
<!DOCTYPE html>
|
|
<html lang="<%= config.language %>">
|
|
|
|
<head>
|
|
<%- partial('_partial/head',{cache: true}) %>
|
|
</head>
|
|
|
|
<body>
|
|
<script>
|
|
// this function is used to check current theme before page loaded.
|
|
(() => {
|
|
const currentTheme = window.localStorage && window.localStorage.getItem('theme') || '';
|
|
const isDark = currentTheme === 'dark';
|
|
const pagebody = document.getElementsByTagName('body')[0]
|
|
if (isDark) {
|
|
pagebody.classList.add('dark-theme');
|
|
// mobile
|
|
document.getElementById("mobile-toggle-theme").innerText = "· Dark"
|
|
} else {
|
|
pagebody.classList.remove('dark-theme');
|
|
// mobile
|
|
document.getElementById("mobile-toggle-theme").innerText = "· Light"
|
|
}
|
|
})();
|
|
</script>
|
|
|
|
<div class="wrapper">
|
|
<%- partial('_partial/header',{cache: true}) %>
|
|
<div class="main">
|
|
<%- body %>
|
|
</div>
|
|
<%- partial('_partial/footer',{cache: true}) %>
|
|
</div>
|
|
</body>
|
|
|
|
</html> |