Skip to content

Build your personal knowledge base with Trilium Notes

fix(server): missing boxicons in desktop/mobile

Elian Doran8e73c5906da3
diff --git a/apps/client/src/share.ts b/apps/client/src/share.ts
index 824dc22ddf..a1e348336f 100644
--- a/apps/client/src/share.ts
+++ b/apps/client/src/share.ts
@@ -1,14 +1,9 @@
import "normalize.css";
+import "boxicons/css/boxicons.min.css";
import "@triliumnext/ckeditor5/content.css";
import "@triliumnext/share-theme/styles/index.css";
import "@triliumnext/share-theme/scripts/index.js";
-async function loadIcons() {
- if (document.getElementById("menu")) {
- await import("boxicons/css/boxicons.min.css");
- }
-}
-
async function ensureJQuery() {
const $ = (await import("jquery")).default;
(window as any).$ = $;
@@ -53,7 +48,6 @@ document.addEventListener(
"DOMContentLoaded",
() => {
formatCodeBlocks();
- loadIcons();
applyMath();
const toggleMenuButton = document.getElementById("toggleMenuButton");
diff --git a/apps/server/src/assets/views/desktop.ejs b/apps/server/src/assets/views/desktop.ejs
index 45356b2540..e635e18226 100644
--- a/apps/server/src/assets/views/desktop.ejs
+++ b/apps/server/src/assets/views/desktop.ejs
@@ -50,6 +50,7 @@
<% } %>
<link href="<%= assetPath %>/stylesheets/style.css" rel="stylesheet">
+<link href="<%= assetPath %>/src/boxicons.css" rel="stylesheet">
<link href="<%= assetPath %>/stylesheets/print.css" rel="stylesheet" media="print">
<script src="<%= appPath %>/runtime.js" crossorigin type="module"></script>
diff --git a/apps/server/src/assets/views/mobile.ejs b/apps/server/src/assets/views/mobile.ejs
index 80778d9ad2..31c3a39639 100644
--- a/apps/server/src/assets/views/mobile.ejs
+++ b/apps/server/src/assets/views/mobile.ejs
@@ -128,6 +128,7 @@
<% } %>
<link href="<%= assetPath %>/stylesheets/style.css" rel="stylesheet">
+<link href="<%= assetPath %>/src/boxicons.css" rel="stylesheet">
<link href="<%= assetPath %>/stylesheets/print.css" rel="stylesheet" media="print">
</body>
diff --git a/packages/share-theme/src/templates/page.ejs b/packages/share-theme/src/templates/page.ejs
index a55ac7cc71..5c39051ebf 100644
--- a/packages/share-theme/src/templates/page.ejs
+++ b/packages/share-theme/src/templates/page.ejs
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
+ <% const hasTree = subRoot.note.hasVisibleChildren(); %>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
@@ -8,6 +9,7 @@
<script src="<%= appPath %>/share.js" type="module"></script>
<% if (!isDev && !note.isLabelTruthy("shareOmitDefaultCss")) { %>
<link href="<%= assetPath %>/src/share.css" rel="stylesheet">
+ <link href="<%= assetPath %>/src/boxicons.css" rel="stylesheet">
<% } %>
<% for (const cssRelation of note.getRelations("shareCss")) { %>
@@ -64,7 +66,6 @@ const themeClass = currentTheme === "light" ? " theme-light" : " theme-dark";
const headingRe = /(<h[1-6]>)(.+?)(<\/h[1-6]>)/g;
const headingMatches = [...content.matchAll(headingRe)];
const slugify = (text) => text.toLowerCase().replace(/[^\w]/g, "-");
-const hasTree = subRoot.note.hasVisibleChildren();
content = content.replaceAll(headingRe, (...match) => {
match[0] = match[0].replace(match[3], `<a id="${slugify(match[2])}" class="toc-anchor" name="${slugify(match[2])}" href="#${slugify(match[2])}">#</a>${match[3]}`);
return match[0];