logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

QMKLayout.vue (810B)


  1. <script setup>
  2. import DefaultTheme from 'vitepress/theme'
  3. import { useRouter } from 'vitepress'
  4. import { onBeforeMount } from 'vue';
  5. import aliases from "../../../../docs/_aliases.json";
  6. const router = useRouter()
  7. onBeforeMount(async () => {
  8. // Convert from docsify-style to vitepress-style URLs
  9. let newUrl = window.location.href.replace(/\/#\//, '/').replace(/\?id=/, '#');
  10. // Convert any aliases
  11. let testUrl = new URL(newUrl);
  12. while (testUrl.pathname in aliases) {
  13. testUrl.pathname = aliases[testUrl.pathname];
  14. }
  15. newUrl = testUrl.toString();
  16. // Redirect if required
  17. if (newUrl != window.location.href) {
  18. window.history.replaceState({}, '', newUrl);
  19. await router.go(newUrl);
  20. }
  21. });
  22. </script>
  23. <template>
  24. <DefaultTheme.Layout/>
  25. </template>