feat: add typo link
This commit is contained in:
24
custom.js
24
custom.js
@@ -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);
|
||||
})();
|
||||
|
Reference in New Issue
Block a user