diff options
author | Nick Brassel <nick@tzarc.org> | 2024-05-30 12:00:41 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-30 12:00:41 +1000 |
commit | 6ef97172889ccd5db376b2a9f8825489e24fdac4 (patch) | |
tree | 334e3bf41c8554d4bee73a140822f95f60eb64e9 /builddefs/docsgen/.vitepress/theme/QMKLayout.vue | |
parent | 395766657ff98a4b1fd0dcba5917557f8acbb9e4 (diff) |
Vitepress conversion of docs. (#23795)
Diffstat (limited to 'builddefs/docsgen/.vitepress/theme/QMKLayout.vue')
-rw-r--r-- | builddefs/docsgen/.vitepress/theme/QMKLayout.vue | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/builddefs/docsgen/.vitepress/theme/QMKLayout.vue b/builddefs/docsgen/.vitepress/theme/QMKLayout.vue new file mode 100644 index 0000000000..30d0780d7c --- /dev/null +++ b/builddefs/docsgen/.vitepress/theme/QMKLayout.vue @@ -0,0 +1,18 @@ +<script setup> +import DefaultTheme from 'vitepress/theme' +import { useRouter } from 'vitepress' +import { onBeforeMount } from 'vue'; + +const router = useRouter() +onBeforeMount(async () => { + if (window.location.href.includes('/#/')) { + const newUrl = window.location.href.replace(/\/#\//, '/').replace(/\?id=/, '#'); + window.history.replaceState({}, '', newUrl); + await router.go(newUrl); + } +}); +</script> + +<template> + <DefaultTheme.Layout/> +</template> |