diff --git a/docs/index.md b/docs/index.md index 5b600fe4343..1b8316b9755 100644 --- a/docs/index.md +++ b/docs/index.md @@ -6,6 +6,10 @@ hero: tagline: "A guide collaboration between Nintendo Homebrew's Helpers and Staff, from stock to Aroma custom firmware." image: src: "/assets/img/home-page-feature.jpg" + +head: [ + ['script', {src: '/assets/js/docsify-wrapper.js'}] +] --- ::: tip diff --git a/docs/public/assets/js/docsify-wrapper.js b/docs/public/assets/js/docsify-wrapper.js new file mode 100644 index 00000000000..8d2f4e24891 --- /dev/null +++ b/docs/public/assets/js/docsify-wrapper.js @@ -0,0 +1,27 @@ +/* + Copyright (C) 2024 Nintendo Homebrew + + SPDX-License-Identifier: MIT +*/ + +const map = new WeakMap() + +function checkDocsify(callback) { + if (map.has(callback)) + return; + map.set(callback, true); + if (document.readyState === 'complete') + callback(); + else + window.addEventListener('load', callback, false); +} + +checkDocsify(() => { + if(!window.location.hash) + return; + + if(window.location.hash[1] == '/') { + path = window.location.hash.substring(1); + window.location.href = path; + } +})