diff --git a/apps/server/src/assets/views/desktop.ejs b/apps/server/src/assets/views/desktop.ejs
index 8d53b914c..6b8c6b7a2 100644
--- a/apps/server/src/assets/views/desktop.ejs
+++ b/apps/server/src/assets/views/desktop.ejs
@@ -8,6 +8,9 @@
Trilium Notes
+
generateCss(p)).join("\n\n")
});
}
@@ -118,10 +119,9 @@ function getThemeCssUrl(theme: string, themeNote: BNote | null) {
return `${assetPath}/stylesheets/theme-next-dark.css`;
} else if (!process.env.TRILIUM_SAFE_MODE && themeNote) {
return `api/notes/download/${themeNote.noteId}`;
- } else {
- // baseline light theme
- return false;
}
+ // baseline light theme
+ return false;
}
function getAppCssNoteIds() {
diff --git a/apps/server/src/services/icon_packs.ts b/apps/server/src/services/icon_packs.ts
index daa327a8d..406d32811 100644
--- a/apps/server/src/services/icon_packs.ts
+++ b/apps/server/src/services/icon_packs.ts
@@ -1,6 +1,7 @@
import type BAttachment from "../becca/entities/battachment";
import type BNote from "../becca/entities/bnote";
import log from "./log";
+import search from "./search/services/search";
const PREFERRED_MIME_TYPE = [
"font/woff2",
@@ -26,6 +27,12 @@ interface ProcessResult {
fontAttachmentId: string;
}
+export function getIconPacks() {
+ return search.searchNotes("#iconPack")
+ .map(iconPackNote => processIconPack(iconPackNote))
+ .filter(Boolean) as ProcessResult[];
+}
+
export function processIconPack(iconPackNote: BNote): ProcessResult | undefined {
const manifest = iconPackNote.getJsonContentSafely() as IconPackManifest;
if (!manifest) {
@@ -65,7 +72,7 @@ export function determineBestFontAttachment(iconPackNote: BNote) {
export function generateCss({ manifest, fontAttachmentId, fontMime }: ProcessResult) {
const iconDeclarations: string[] = [];
for (const [ key, mapping ] of Object.entries(manifest.icons)) {
- iconDeclarations.push(`.${manifest.prefix}.${key}::before { content: '\\${mapping.charCodeAt(0).toString(16)}' }`);
+ iconDeclarations.push(`.${manifest.prefix}.${key}::before { content: '\\${mapping.charCodeAt(0).toString(16)}'; }`);
}
return `\