mirror of
https://github.com/Ellpeck/TinyLifeWeb.git
synced 2024-11-18 01:30:08 +01:00
17 lines
809 B
HTML
17 lines
809 B
HTML
<div class="nav-item dropdown">
|
|
<a class="nav-link dropdown-toggle" type="button" data-toggle="dropdown">🧭 Navigation</a>
|
|
<div class="dropdown-menu">
|
|
<div id="navigator-content" style="height: auto; max-height: 50vh; overflow-y: scroll;"></div>
|
|
<script>
|
|
$(() => $("{{ include.headers }}").each((i, h) => {
|
|
console.log(h);
|
|
let offset = `${0.5 + Number(h.nodeName.substring(1)) - 1}rem`;
|
|
console.log(offset);
|
|
$("#navigator-content").append(`
|
|
<a class="nav-item nav-link dropdown-item-text" href="#${h.id}" style="padding-left: ${offset}; white-space: nowrap;">
|
|
${h.innerText.trim()}
|
|
</a>`);
|
|
}));
|
|
</script>
|
|
</div>
|
|
</div>
|