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,5 +1,10 @@
<div class="not-by-ai-image">
<div class="markdown-footer">
<div class="not-by-ai-image">
<a href="https://notbyai.fyi/" target="_blank" rel="noreferrer">
<img alt="nobyai logo" src="https://user-images.githubusercontent.com/62137266/225653923-a69103f5-b318-4e52-9ea1-95b61d388366.svg"></img>
</a>
</div>
<div class="typo-link">
<a id="typo-link" href="#" target="_blank">Typo?</a>
</div>
</div>

View File

@@ -4,8 +4,10 @@
margin-bottom: var(--pico-block-spacing-vertical);
}
.not-by-ai-image {
text-align: right;
.markdown-footer {
display: flex;
justify-content: space-between;
align-items: center;
}
a code {

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);
})();