Permalinks for website section heads (#272)

* Permalinks for website section heads

* Tabs vs spaces strikes again
This commit is contained in:
Anthony Atkinson
2023-11-08 04:43:40 -05:00
committed by GitHub
parent ca62dd3150
commit 1a5d1847b6
2 changed files with 22 additions and 0 deletions

View File

@@ -8,4 +8,14 @@ document.addEventListener('DOMContentLoaded', function() {
});
}
});
// Add permalinks to headers
var heads = document.querySelectorAll('.sectionHead');
heads.forEach(function (head) {
let permalink = document.createElement("a");
permalink.href = '#' + head.id;
permalink.classList.add('permalink');
permalink.append('🔗');
head.append(permalink);
});
});