From 6e31dacfac664709a3b4e6166f629af56695a503 Mon Sep 17 00:00:00 2001 From: bryantgillespie Date: Thu, 11 Jun 2026 17:40:54 -0400 Subject: [PATCH] Improve release notes navigation and search --- app/composables/useSectionNavigation.ts | 22 ++++++++++++++-------- content/releases/2.changelog.md | 1 + scripts/index-docs-chunker.ts | 1 - shared/utils/docsSections.ts | 12 ++++++++++-- 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/app/composables/useSectionNavigation.ts b/app/composables/useSectionNavigation.ts index 77718949..dd30e004 100644 --- a/app/composables/useSectionNavigation.ts +++ b/app/composables/useSectionNavigation.ts @@ -58,16 +58,24 @@ export function useSectionNavigation(options: { immediate?: boolean } = {}) { children: item.children?.map(collapseDescendants), }); - const sectionNavigation = computed(() => { - const section = currentSection.value; - if (!section) return []; - - const topLevel = section.id === 'deploy' || section.id === 'community' + const getSectionTopLevel = (section: DocsSection) => { + const topLevel = section.id === 'deploy' ? section.prefixes .map(findRoot) .filter((item): item is ContentNavigationItem => item !== null) : findRoot(section.prefixes[0]!)?.children ?? []; + return section.id === 'releases' + ? topLevel.filter(item => item.path !== section.to) + : topLevel; + }; + + const sectionNavigation = computed(() => { + const section = currentSection.value; + if (!section) return []; + + const topLevel = getSectionTopLevel(section); + return topLevel.map(item => ({ ...item, children: item.children?.map(collapseDescendants), @@ -95,9 +103,7 @@ export function useSectionNavigation(options: { immediate?: boolean } = {}) { const mobileNavigationTree = computed(() => { if (currentGroup.value?.id === 'docs') { return groupSections.value.flatMap((section) => { - const topLevel = section.id === 'deploy' || section.id === 'community' - ? section.prefixes.map(findRoot).filter((item): item is ContentNavigationItem => item !== null) - : findRoot(section.prefixes[0]!)?.children ?? []; + const topLevel = getSectionTopLevel(section); const items = topLevel.map(item => ({ ...item, children: item.children?.map(collapseDescendants), diff --git a/content/releases/2.changelog.md b/content/releases/2.changelog.md index 83c5dda8..8a9c6746 100644 --- a/content/releases/2.changelog.md +++ b/content/releases/2.changelog.md @@ -1,5 +1,6 @@ --- stableId: b28e12b3-a906-4907-b5e5-2f9c25a92d08 +title: Changelog description: A monthly summary of what's new from the Directus team. --- diff --git a/scripts/index-docs-chunker.ts b/scripts/index-docs-chunker.ts index 924090fc..dcd0f45d 100644 --- a/scripts/index-docs-chunker.ts +++ b/scripts/index-docs-chunker.ts @@ -584,7 +584,6 @@ export function collectMarkdownDocuments() { const partials = loadPartials(); const files = listRoutableContentFiles('content').filter(file => { if (file.startsWith('content/_partials/')) return false; - if (file.startsWith('content/releases/')) return false; return true; }); diff --git a/shared/utils/docsSections.ts b/shared/utils/docsSections.ts index 4442429c..ae0b8a9c 100644 --- a/shared/utils/docsSections.ts +++ b/shared/utils/docsSections.ts @@ -8,6 +8,7 @@ export type DocsSectionId | 'reference' | 'api' | 'community' + | 'releases' | 'licensing'; export type DocsGroupId = 'docs' | 'reference' | 'legacy-reference' | 'examples' | 'licensing'; @@ -89,9 +90,16 @@ export const docsSections: DocsSection[] = [ id: 'community', label: 'Community', to: '/community/overview/welcome', - prefixes: ['/community', '/releases'], + prefixes: ['/community'], icon: 'i-lucide-users', }, + { + id: 'releases', + label: 'Releases', + to: '/releases', + prefixes: ['/releases'], + icon: 'i-lucide-tag', + }, { id: 'licensing', label: 'Licensing', @@ -107,7 +115,7 @@ export const docsGroups: DocsGroup[] = [ label: 'Docs', to: '/getting-started/overview', icon: 'i-lucide-book-open', - sectionIds: ['getting-started', 'guides', 'deploy', 'configuration', 'frameworks', 'community'], + sectionIds: ['getting-started', 'guides', 'deploy', 'configuration', 'frameworks', 'community', 'releases'], }, { id: 'reference',