<%
const isCommitHash = /^[0-9a-f]{40}$/.test(it.branch);
const refLabel = isCommitHash ? it.branch.slice(0, 7) : it.branch;
%>
<% if (it.path && it.path !== "/") { %>
<%
const crumbHrefBase = `/${it.repo.owner}/${it.repo.name}/${it.view === "blob" ? "tree" : it.view}/${it.branch}`;
%>
(top)<%
const pathParts = it.path.split('/').filter(p => p);
let currentPath = '';
for (let i = 0; i < pathParts.length; i++) {
const part = pathParts[i];
currentPath += (currentPath ? '/' : '') + part;
const isLast = i === pathParts.length - 1;
if (isLast) {
%>/<%= part %><%= it.view === "tree" ? "/" : "" %><%
} else {
%>/<%= part %><%
}
} %>
<% } %>