Skip to content

Build your personal knowledge base with Trilium Notes

fix(export/zip): stylesheet not embedded due to wrong path

Elian Doran6e46ab05981a
diff --git a/apps/server/src/services/export/zip.ts b/apps/server/src/services/export/zip.ts
index 5974d77eb9..6b5a28b1d8 100644
--- a/apps/server/src/services/export/zip.ts
+++ b/apps/server/src/services/export/zip.ts
@@ -6,7 +6,7 @@ import path from "path";
import mimeTypes from "mime-types";
import mdService from "./markdown.js";
import packageInfo from "../../../package.json" with { type: "json" };
-import { getContentDisposition, escapeHtml } from "../utils.js";
+import { getContentDisposition, escapeHtml, getResourceDir } from "../utils.js";
import protectedSessionService from "../protected_session.js";
import sanitize from "sanitize-filename";
import fs from "fs";
@@ -20,7 +20,6 @@ import type AttachmentMeta from "../meta/attachment_meta.js";
import type AttributeMeta from "../meta/attribute_meta.js";
import type BBranch from "../../becca/entities/bbranch.js";
import type { Response } from "express";
-import { RESOURCE_DIR } from "../resource_dir.js";
import type { NoteMetaFile } from "../meta/note_meta.js";
type RewriteLinksFn = (content: string, noteMeta: NoteMeta) => string;
@@ -512,7 +511,7 @@ ${markdownContent}`;
return;
}
- const cssContent = fs.readFileSync(`${RESOURCE_DIR}/libraries/ckeditor/ckeditor-content.css`);
+ const cssContent = fs.readFileSync(`${getResourceDir()}/public/libraries/ckeditor/ckeditor-content.css`);
archive.append(cssContent, { name: cssMeta.dataFileName });
}