_includes/head.html in dark-blog-theme-1.1.0 vs _includes/head.html in dark-blog-theme-2.0.0
- old
+ new
@@ -1,10 +1,27 @@
<head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta charset="utf-8" />
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <link
+ rel="preload"
+ href="/assets/theme-assets/theme-fonts/Virgil.woff2"
+ as="font"
+ type="font/woff2"
+ crossorigin
+ />
<link rel="stylesheet" href="{{ "/assets/main.css" | relative_url }}">
- {% comment %} {%- feed_meta -%} {% endcomment %}
- {%- if jekyll.environment == 'production' and site.google_analytics -%}
- {%- include google-analytics.html -%}
- {%- endif -%}
+ <script>
+ const root = document.querySelector("html");
+ const theme = window.localStorage.getItem("theme");
+ if (theme === null) {
+ window.localStorage.setItem("theme", "dark-pink");
+ root.className = "dark-pink";
+ } else {
+ root.className = theme;
+ }
+ </script>
+ <script src="/assets/theme-assets/js/theme.js" defer></script>
+ {% comment %} {%- feed_meta -%} {% endcomment %} {%- if jekyll.environment ==
+ 'production' and site.google_analytics -%} {%- include google-analytics.html
+ -%} {%- endif -%}
</head>