From c672ae303d3ea22a73fff184ff191eb7bc9ad788 Mon Sep 17 00:00:00 2001 From: Andrea Date: Sun, 3 Aug 2025 16:29:12 +0200 Subject: [PATCH] feat: add typo link --- content/_markdown_footer.md | 13 +++++++++---- custom.css | 6 ++++-- custom.js | 24 +++++++++++++++++++++--- 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/content/_markdown_footer.md b/content/_markdown_footer.md index f4cd493..63445a1 100644 --- a/content/_markdown_footer.md +++ b/content/_markdown_footer.md @@ -1,5 +1,10 @@ -
- - nobyai logo - + diff --git a/custom.css b/custom.css index 378c275..c0eccc9 100644 --- a/custom.css +++ b/custom.css @@ -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 { diff --git a/custom.js b/custom.js index bfa0dd3..0deba3d 100644 --- a/custom.js +++ b/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); +})();