From 8ec9ac0fa34d97cbc06cbd4e7b7c7fbff0be2230 Mon Sep 17 00:00:00 2001 From: aspen Date: Mon, 15 Sep 2025 04:26:05 +1200 Subject: [PATCH 1/2] feat(nav): add Home button on sub-pages and hide current page from nav --- src/components/PageStrcture/Nav.vue | 36 ++++++++++++++++++----------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/components/PageStrcture/Nav.vue b/src/components/PageStrcture/Nav.vue index 781d776fb3..58a2e48aef 100644 --- a/src/components/PageStrcture/Nav.vue +++ b/src/components/PageStrcture/Nav.vue @@ -6,21 +6,19 @@ /> @@ -44,15 +42,22 @@ export default { isMobile: false, }), computed: { - /* Get links to sub-pages, and combine with nav-links */ + /* Build nav links: custom links + sub-pages (excluding current) + optional Home button */ allLinks() { - const subPages = this.$store.getters.pages.filter((page) => checkPageVisibility(page)) + const currentSubPageId = this.$store.state.currentConfigInfo?.confId || null; + let subPages = this.$store.getters.pages + .filter((page) => checkPageVisibility(page)) .map((subPage) => ({ path: makePageSlug(subPage.name, 'home'), title: subPage.name, + _isSubPage: true, })); + if (currentSubPageId) { + subPages = subPages.filter(p => !p.path.endsWith(`/${currentSubPageId}`)); + } const navLinks = this.links || []; - return [...navLinks, ...subPages]; + const homeButton = currentSubPageId ? [{ path: '/home/', title: 'Home', _isHome: true }] : []; + return [...navLinks, ...subPages, ...homeButton]; }, }, created() { @@ -107,6 +112,9 @@ export default { border: 1px solid var(--nav-link-border-color-hover); box-shadow: var(--nav-link-shadow-hover); } + &.home-button { + font-weight: 600; + } } } /* Mobile and Burger-Menu Styles */ From 73f5a85506d795cd2f42f0388e51bb2751fa1fe7 Mon Sep 17 00:00:00 2001 From: aspen Date: Thu, 18 Sep 2025 05:50:28 +1200 Subject: [PATCH 2/2] fix(nav): move v-for key to rendered elements and fix indentation --- src/components/PageStrcture/Nav.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/PageStrcture/Nav.vue b/src/components/PageStrcture/Nav.vue index 58a2e48aef..1d387de382 100644 --- a/src/components/PageStrcture/Nav.vue +++ b/src/components/PageStrcture/Nav.vue @@ -6,14 +6,16 @@ />