mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 11:56:01 +01:00
fix(export/share): favicon working only on top-level
This commit is contained in:
@@ -81,6 +81,7 @@ export function renderNoteForExport(note: BNote, parentBranch: BBranch, basePath
|
|||||||
`${basePath}assets/scripts.js`
|
`${basePath}assets/scripts.js`
|
||||||
],
|
],
|
||||||
logoUrl: `${basePath}icon-color.svg`,
|
logoUrl: `${basePath}icon-color.svg`,
|
||||||
|
faviconUrl: `${basePath}favicon.ico`,
|
||||||
ancestors,
|
ancestors,
|
||||||
isStatic: true
|
isStatic: true
|
||||||
});
|
});
|
||||||
@@ -128,7 +129,8 @@ export function renderNoteContent(note: SNote) {
|
|||||||
jsToLoad,
|
jsToLoad,
|
||||||
logoUrl,
|
logoUrl,
|
||||||
ancestors,
|
ancestors,
|
||||||
isStatic: false
|
isStatic: false,
|
||||||
|
faviconUrl: note.hasRelation("shareFavicon") ? `api/notes/${note.getRelationValue("shareFavicon")}/download` : `../favicon.ico`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,6 +142,7 @@ interface RenderArgs {
|
|||||||
logoUrl: string;
|
logoUrl: string;
|
||||||
ancestors: string[];
|
ancestors: string[];
|
||||||
isStatic: boolean;
|
isStatic: boolean;
|
||||||
|
faviconUrl: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderNoteContentInternal(note: SNote | BNote, renderArgs: RenderArgs) {
|
function renderNoteContentInternal(note: SNote | BNote, renderArgs: RenderArgs) {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
<link rel="shortcut icon" href="<% if (note.hasRelation("shareFavicon")) { %>api/notes/<%= note.getRelation("shareFavicon").value %>/download<% } else { %>../favicon.ico<% } %>">
|
<link rel="shortcut icon" href="<%= faviconUrl %>">
|
||||||
<% for (const url of cssToLoad) { %>
|
<% for (const url of cssToLoad) { %>
|
||||||
<link href="<%= url %>" rel="stylesheet">
|
<link href="<%= url %>" rel="stylesheet">
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|||||||
Reference in New Issue
Block a user