feat: add typo link

This commit is contained in:
2025-08-03 16:29:12 +02:00
parent 40789a77ca
commit c672ae303d
3 changed files with 34 additions and 9 deletions

View File

@@ -1,3 +1,21 @@
/**
* Additional js
*/
(() => {
/**
* @param {HTMLAnchorElement} anchorElement
*/
function setTypoLink(anchorElement) {
const fileName = window.location.pathname
.replace(".html", "")
.replaceAll("-", "_");
const gitLink = `https://git.nullndr.com/nullndr/website/src/branch/main/content${fileName}.md`;
anchorElement.href = gitLink;
}
/**
* @type {HTMLAnchorElement}
*/
const typoLink = document.getElementById("typo-link");
if (typoLink) setTypoLink(typoLink);
})();