mirror of
https://github.com/zadam/trilium.git
synced 2026-01-03 13:14:24 +01:00
git-subtree-dir: packages/share-theme git-subtree-mainline: d8f0709bce891a8ebc0676bb3b6b5314bf78a129 git-subtree-split: 2cdd2a0a543f0bced8284ca55bc94efadbc7c91f
20 lines
418 B
Plaintext
20 lines
418 B
Plaintext
<%
|
|
const slugify = (text) => text.toLowerCase().replace(/[^\w]/g, "-");
|
|
const slug = slugify(entry.name);
|
|
%>
|
|
|
|
|
|
<li>
|
|
<a href="#<%= slug %>">
|
|
<span><%= entry.name %></span>
|
|
</a>
|
|
|
|
<% if (entry.children.length) { %>
|
|
<ul>
|
|
<% for (const subentry of entry.children) { %>
|
|
<%- include('toc_item', {entry: subentry}) %>
|
|
<% } %>
|
|
</ul>
|
|
<% } %>
|
|
</li>
|