mirror of
https://github.com/zadam/trilium.git
synced 2025-11-07 22:05:44 +01:00
feat(export/share): export without inner subdirectory
This commit is contained in:
@@ -371,10 +371,12 @@ async function exportToZip(taskContext: TaskContext<"export">, branch: BBranch,
|
||||
}
|
||||
|
||||
if (noteMeta.children?.length || 0 > 0) {
|
||||
const directoryPath = filePathPrefix + noteMeta.dirFileName;
|
||||
const directoryPath = filePathPrefix !== "" || format !== "share" ? filePathPrefix + noteMeta.dirFileName : "";
|
||||
|
||||
// create directory
|
||||
if (directoryPath) {
|
||||
archive.append("", { name: `${directoryPath}/`, date: dateUtils.parseDateTime(note.utcDateModified) });
|
||||
}
|
||||
|
||||
for (const childMeta of noteMeta.children || []) {
|
||||
saveNote(childMeta, `${directoryPath}/`);
|
||||
|
||||
@@ -58,7 +58,7 @@ export default class ShareThemeExportProvider extends ZipExportProvider {
|
||||
if (!noteMeta?.notePath?.length) {
|
||||
throw new Error("Missing note path.");
|
||||
}
|
||||
const basePath = "../".repeat(noteMeta.notePath.length - 1);
|
||||
const basePath = "../".repeat(Math.max(0, noteMeta.notePath.length - 2));
|
||||
let searchContent = "";
|
||||
|
||||
if (note) {
|
||||
|
||||
Reference in New Issue
Block a user