From dd59e1177f44d02657189618dabb7db9f33c8989 Mon Sep 17 00:00:00 2001
From: nschimme <5505185+nschimme@users.noreply.github.com>
Date: Sat, 2 May 2026 22:06:03 +0000
Subject: [PATCH 1/2] fix: navigation highlighting logic and update Wiki
absolute URL
- Refactored `isActive` logic in `Layout.vue` to ensure the "Community" navbar item is only highlighted (gold) on the home page.
- Ensured "Open Source", "Links", and "Interviews" sections correctly highlight their parent navigation items when their respective pages or sub-pages are active.
- Updated all MUME Wiki links to use the absolute path `https://docs.mume.org/wiki/`.
---
docs/.vitepress/config.js | 2 +-
docs/.vitepress/theme/Layout.vue | 26 +++++++++++++++++++++-----
docs/index.md | 2 +-
3 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js
index d9852bf..9163315 100644
--- a/docs/.vitepress/config.js
+++ b/docs/.vitepress/config.js
@@ -26,7 +26,7 @@ export default defineConfig({
{ text: 'Open Source', link: '/opensource' },
{ text: 'Links', link: '/links' },
{ text: 'Interviews', link: '/interviews/' },
- { text: 'Wiki', link: 'https://mume.org/wiki/' }
+ { text: 'Wiki', link: 'https://docs.mume.org/wiki/' }
]
}
]
diff --git a/docs/.vitepress/theme/Layout.vue b/docs/.vitepress/theme/Layout.vue
index 3fea18b..6cb92fc 100644
--- a/docs/.vitepress/theme/Layout.vue
+++ b/docs/.vitepress/theme/Layout.vue
@@ -10,6 +10,22 @@ import './mume.css'
const { site, page, frontmatter } = useData()
const vpRoute = useRoute()
+const isActive = (path, exact = false) => {
+ const target = withBase(path)
+ const current = vpRoute.path
+
+ if (exact) {
+ return current === target || (target === '/' && (current === '/' || current === '/index.html'))
+ }
+
+ if (target === '/') return current === '/' || current === '/index.html'
+
+ const normalizedTarget = target.endsWith('/') ? target : target + '/'
+ const normalizedCurrent = current.endsWith('/') ? current : current + '/'
+
+ return normalizedCurrent.startsWith(normalizedTarget)
+}
+
const isMenuOpen = ref(false)
const navbarRef = ref(null)
const gandalfRef = ref(null)
@@ -70,14 +86,14 @@ onUnmounted(() => {
Play
The official Wiki contains tips, hints, and all sorts of useful information for newcomers and veterans alike.
-Visit the Wiki +Visit the Wiki From dbcf007013d811fcc9676ac9dddd91b4a4006f13 Mon Sep 17 00:00:00 2001 From: nschimme <5505185+nschimme@users.noreply.github.com> Date: Sat, 2 May 2026 23:51:05 +0000 Subject: [PATCH 2/2] fix: nav highlighting and wiki link behavior - Restricted 'Community' nav highlight to the home page only. - Ensured 'Open Source', 'Links', and 'Interviews' parents highlight when active. - Updated Wiki link to absolute path 'https://docs.mume.org/wiki/'. - Added 'target="_self"' and 'rel="external"' to Wiki links to ensure they open in the same tab and prevent VitePress router interference. --- docs/.vitepress/theme/Layout.vue | 2 +- docs/index.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/.vitepress/theme/Layout.vue b/docs/.vitepress/theme/Layout.vue index 6cb92fc..fab5928 100644 --- a/docs/.vitepress/theme/Layout.vue +++ b/docs/.vitepress/theme/Layout.vue @@ -93,7 +93,7 @@ onUnmounted(() => {The official Wiki contains tips, hints, and all sorts of useful information for newcomers and veterans alike.
-Visit the Wiki +Visit the Wiki