Fix theme to dark and hide the theme switch in the share template

This commit is contained in:
trilium-share-gruvbox
2026-09-07 21:47:03 +02:00
parent 7d5c9ef81a
commit ce6dbe1bab
+3 -5
View File
@@ -69,13 +69,11 @@
const openGraphDomain = subRoot.note.getLabelValue("shareOpenGraphDomain");
%>
<title><%= pageTitle %></title>
<style>#site-header .theme-selection{display:none}</style>
<% if (pageUrl) { %><link rel="canonical" href="<%= pageUrl %>"><% } %>
<script>
// Load dark/light theme as soon as possible to avoid color flashes.
let theme = localStorage.getItem("theme");
if (!theme) {
theme = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? "dark" : "light";
}
// Theme is fixed to dark light/dark switching is disabled.
const theme = "dark";
document.documentElement.classList.add(`theme-${theme}`);
window.glob = {