feat(export/zip): basic tree navigation

This commit is contained in:
Elian Doran 2025-06-14 00:07:55 +03:00
parent 4d5e866db6
commit d8958adea5
No known key found for this signature in database
2 changed files with 13 additions and 1 deletions

View File

@ -333,6 +333,9 @@ async function exportToZip(taskContext: TaskContext, branch: BBranch, format: "h
if (note) {
content = renderNoteForExport(note, branch, basePath);
// TODO: Fix double rewrite.
content = rewriteFn(content, noteMeta);
} else {
const cssUrl = basePath + "style.css";
// <base> element will make sure external links are openable - https://github.com/zadam/trilium/issues/1289#issuecomment-704066809

View File

@ -1,7 +1,16 @@
<%
const linkClass = `type-${note.type}` + (activeNote.noteId === note.noteId ? " active" : "");
const isExternalLink = note.hasLabel("shareExternal");
const linkHref = isExternalLink ? note.getLabelValue("shareExternal") : `./${note.shareId}`;
let linkHref;
if (isExternalLink) {
linkHref = note.getLabelValue("shareExternal");
} else if (note.shareId) {
linkHref = `./${note.shareId}`;
} else {
linkHref = `#${note.getBestNotePath().join("/")}`;
}
const target = isExternalLink ? ` target="_blank" rel="noopener noreferrer"` : "";
%>