Merge commit '5be51ac3db225d5df501ed1fa1499c41d97dbf65'

This commit is contained in:
Bjørn Erik Pedersen
2025-04-10 13:04:51 +02:00
987 changed files with 12379 additions and 14083 deletions

View File

@@ -1,6 +1,24 @@
export const navbar = (Alpine) => ({
init: function () {
Alpine.bind(this.$root, this.root);
return this.$nextTick(() => {
let contentEl = document.querySelector('.content:not(.content--ready)');
if (contentEl) {
contentEl.classList.add('content--ready');
let anchorTemplate = document.getElementById('anchor-heading');
if (anchorTemplate) {
let els = contentEl.querySelectorAll('h2[id], h3[id], h4[id], h5[id], h6[id], dt[id]');
for (let i = 0; i < els.length; i++) {
let el = els[i];
el.classList.add('group');
let a = anchorTemplate.content.cloneNode(true).firstElementChild;
a.href = '#' + el.id;
el.appendChild(a);
}
}
}
});
},
root: {
['@scroll.window.debounce.10ms'](event) {