<%= note.title %>
<% if (isEmpty && (!note.hasVisibleChildren() && note.type !== "book")) { %>This note has no content.
<% } else { %> <% content = content.replace(/% const hasTree = subRoot.note.hasVisibleChildren(); // Collect HTML snippets by location const htmlSnippetsByLocation = {}; for (const htmlRelation of note.getRelations("shareHtml")) { const htmlNote = htmlRelation.targetNote; if (htmlNote) { let location = htmlNote.getLabelValue("shareHtmlLocation") || "content:end"; // Default to :end if no position specified if (!location.includes(":")) { location = location + ":end"; } if (!htmlSnippetsByLocation[location]) { htmlSnippetsByLocation[location] = []; } htmlSnippetsByLocation[location].push(htmlNote.getContent()); } } const renderSnippets = (location) => { const snippets = htmlSnippetsByLocation[location]; return snippets ? snippets.join("\n") : ""; }; %> <%- renderSnippets("head:start") %> api/notes/<%= note.getRelation("shareFavicon").value %>/download<% } else { %>../favicon.ico<% } %>"> <% if (!isDev && !note.isLabelTruthy("shareOmitDefaultCss")) { %> <% } %> <% for (const cssRelation of note.getRelations("shareCss")) { %> <% } %> <% for (const jsRelation of note.getRelations("shareJs")) { %> <% } %> <% if (note.hasLabel("shareDisallowRobotIndexing")) { %> <% } %> <% const pageTitle = `${note.title}${note.noteId !== subRoot.note.noteId ? ` - ${subRoot.note.title}` : ""}`; // Setup some key OpenGraph variables const openGraphColor = subRoot.note.getLabelValue("shareOpenGraphColor"); const openGraphURL = subRoot.note.getLabelValue("shareOpenGraphURL"); const openGraphDomain = subRoot.note.getLabelValue("shareOpenGraphDomain"); let openGraphImage = subRoot.note.getLabelValue("shareOpenGraphImage"); // Relation takes priority and requires some altering if (subRoot.note.hasRelation("shareOpenGraphImage")) { openGraphImage = `api/images/${subRoot.note.getRelation("shareOpenGraphImage").value}/image.png`; } %>
This note has no content.
<% } else { %> <% content = content.replace(/