-
- <% for (const childNote of note.getVisibleChildNotes()) { %>
+ <%
+ for (const childNote of note.getVisibleChildNotes()) {
+ const isExternalLink = childNote.hasLabel('shareExternalLink');
+ const linkHref = isExternalLink ? childNote.getLabelValue('shareExternalLink') : `./${childNote.shareId}`;
+ const target = isExternalLink ? `target="_blank" rel="noopener noreferrer"` : '';
+ %>
- - class="type-<%= childNote.type %>"><%= childNote.title %> <% } %> diff --git a/src/views/share/tree_item.ejs b/src/views/share/tree_item.ejs index 12eec3fbb..f139be8ac 100644 --- a/src/views/share/tree_item.ejs +++ b/src/views/share/tree_item.ejs @@ -1,10 +1,16 @@ +<% +const isExternalLink = note.hasLabel('shareExternalLink'); +const linkHref = isExternalLink ? note.getLabelValue('shareExternalLink') : `./${note.shareId}`; +const target = isExternalLink ? ` target="_blank" rel="noopener noreferrer"` : ''; +console.log(note.shareId, note.title, isExternalLink, linkHref, target); +%>
<% const titleWithPrefix = (branch.prefix ? `${branch.prefix} - ` : '') + note.title; %> <% if (activeNote.noteId === note.noteId) { %> <%= titleWithPrefix %> <% } else { %> - <%= titleWithPrefix %> + ><%= titleWithPrefix %> <% } %>