Skip to content

Build your personal knowledge base with Trilium Notes

feat(export/share): prefer #shareAlias

Elian Doranbe98a2743981
diff --git a/apps/server/src/services/export/zip.ts b/apps/server/src/services/export/zip.ts
index f7ef70bc83..76592af1a2 100644
--- a/apps/server/src/services/export/zip.ts
+++ b/apps/server/src/services/export/zip.ts
@@ -117,6 +117,9 @@ async function exportToZip(taskContext: TaskContext<"export">, branch: BBranch,
const title = note.getTitleOrProtected();
const completeTitle = branch.prefix ? `${branch.prefix} - ${title}` : title;
let baseFileName = sanitize(completeTitle);
+ if (format === "share") {
+ baseFileName = sanitize(note.getOwnedLabelValue("shareAlias") || baseFileName);
+ }
if (baseFileName.length > 200) {
// the actual limit is 256 bytes(!) but let's be conservative