diff --git a/assets/js/alpinejs/data/navbar.js b/assets/js/alpinejs/data/navbar.js
index d2b119f0c..ecf31af0e 100644
--- a/assets/js/alpinejs/data/navbar.js
+++ b/assets/js/alpinejs/data/navbar.js
@@ -1,6 +1,23 @@
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];
+ let a = anchorTemplate.content.cloneNode(true).firstElementChild;
+ a.href = '#' + el.id;
+ el.appendChild(a);
+ }
+ }
+ }
+ });
},
root: {
['@scroll.window.debounce.10ms'](event) {
diff --git a/hugo.toml b/hugo.toml
index 8c43c8a04..71316a456 100644
--- a/hugo.toml
+++ b/hugo.toml
@@ -88,7 +88,8 @@ disableAliases = true
[markup.goldmark.parser]
autoHeadingID = true
- autoHeadingIDType = "github"
+ autoDefinitionTermID = true
+ autoIDType = "github"
[markup.goldmark.parser.attribute]
block = true
diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html
index c0e6c63ec..eb3a38f8e 100644
--- a/layouts/_default/_markup/render-heading.html
+++ b/layouts/_default/_markup/render-heading.html
@@ -1,10 +1 @@
-