19 lines
408 B
Plaintext

<%
const strippedName = utils.stripTags(entry.name);
const slug = utils.slugify(strippedName);
%>
<li>
<a href="#<%= slug %>">
<span><%= strippedName %></span>
</a>
<% if (entry.children.length) { %>
<ul>
<% for (const subentry of entry.children) { %>
<%- include('toc_item', {entry: subentry}) %>
<% } %>
</ul>
<% } %>
</li>