Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions app/composables/useSectionNavigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,24 @@ export function useSectionNavigation(options: { immediate?: boolean } = {}) {
children: item.children?.map(collapseDescendants),
});

const sectionNavigation = computed<ContentNavigationItem[]>(() => {
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<ContentNavigationItem[]>(() => {
const section = currentSection.value;
if (!section) return [];

const topLevel = getSectionTopLevel(section);

return topLevel.map(item => ({
...item,
children: item.children?.map(collapseDescendants),
Expand Down Expand Up @@ -95,9 +103,7 @@ export function useSectionNavigation(options: { immediate?: boolean } = {}) {
const mobileNavigationTree = computed<ContentNavigationItem[]>(() => {
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),
Expand Down
1 change: 1 addition & 0 deletions content/releases/2.changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
stableId: b28e12b3-a906-4907-b5e5-2f9c25a92d08
title: Changelog
description: A monthly summary of what's new from the Directus team.
---

Expand Down
1 change: 0 additions & 1 deletion scripts/index-docs-chunker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});

Expand Down
12 changes: 10 additions & 2 deletions shared/utils/docsSections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export type DocsSectionId
| 'reference'
| 'api'
| 'community'
| 'releases'
| 'licensing';

export type DocsGroupId = 'docs' | 'reference' | 'legacy-reference' | 'examples' | 'licensing';
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand Down
Loading