Skip to content

Build your personal knowledge base with Trilium Notes

fix display of children notes in an empty note, closes #2536

zadamf2732bcab711
diff --git a/src/views/share/page.ejs b/src/views/share/page.ejs
index a9dde1f838..b7506b853e 100644
--- a/src/views/share/page.ejs
+++ b/src/views/share/page.ejs
@@ -40,10 +40,7 @@
<div id="noteClippedFrom">This note was originally clipped from <a href="<%= note.getLabelValue("pageUrl") %>"><%= note.getLabelValue("pageUrl") %></a></div>
<% } %>
- <% if (note.type === 'book') { %>
- <% } else if (isEmpty) { %>
- <p>This note has no content.</p>
- <% } else { %>
+ <% if (!isEmpty) { %>
<div id="content" class="type-<%= note.type %><% if (note.type === 'text') { %> ck-content<% } %>">
<%- content %>
</div>
@@ -52,20 +49,21 @@
<% if (note.hasChildren()) { %>
<nav id="childLinks" class="<% if (isEmpty) { %>grid<% } else { %>list<% } %>">
<% if (!isEmpty) { %>
- <div id="noteClippedFrom">
+ <hr>
<span>Child notes: </span>
- <ul>
- <% for (const childNote of note.getChildNotes()) { %>
- <li>
- <a href="<%= childNote.shareId %>"
- class="type-<%= childNote.type %>"><%= childNote.title %></a>
- </li>
- <% } %>
- </ul>
- </div>
<% } %>
+ <ul>
+ <% for (const childNote of note.getChildNotes()) { %>
+ <li>
+ <a href="<%= childNote.shareId %>"
+ class="type-<%= childNote.type %>"><%= childNote.title %></a>
+ </li>
+ <% } %>
+ </ul>
</nav>
+ <% } else if (isEmpty) { %>
+ <p>This note has no content.</p>
<% } %>
</div>