From 65574135e9fd0f2927c8654ccea3f2e0ad2be7ab Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Wed, 9 Sep 2026 12:46:32 +0200 Subject: [PATCH] docs: the Figma entry links out, it is not a page The sidebar followed the frontmatter `to`, but the surround, the sitemap, the llms sections, the raw markdown listing and the MCP resource each resolve the docs collection on their own, so each skips it now. The stub's own path and the old /figma page redirect to the kit. --- docs/app/composables/useNavigation.ts | 4 +++- docs/content.config.ts | 3 ++- docs/nuxt.config.ts | 9 ++++++++- docs/server/mcp/resources/documentation-pages.ts | 3 ++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/docs/app/composables/useNavigation.ts b/docs/app/composables/useNavigation.ts index 9298608f3..44a53c115 100644 --- a/docs/app/composables/useNavigation.ts +++ b/docs/app/composables/useNavigation.ts @@ -182,8 +182,10 @@ export const useNavigation = (navigation: Ref filterChildrenByFramework(item, fwk, studioIcons)?.children) ?? [] + ?.flatMap(item => filterChildrenByFramework(item, fwk, studioIcons)?.children) + .filter(item => !item?.to) ?? [] const index = flattenNavigation.findIndex(item => item?.path === path) if (index === -1) { diff --git a/docs/content.config.ts b/docs/content.config.ts index 1552cbc0d..97102a065 100644 --- a/docs/content.config.ts +++ b/docs/content.config.ts @@ -78,7 +78,8 @@ export const collections = { // points at `to` instead of the page's own path. to: z.string().optional(), target: z.string().optional(), - sitemap + // an entry that links out is not a page to index + sitemap: defineSitemapSchema({ z, name: 'docs', filter: entry => !entry.to }) }) }), showcase: defineCollection({ diff --git a/docs/nuxt.config.ts b/docs/nuxt.config.ts index ad7ba0c3d..acde6aaab 100644 --- a/docs/nuxt.config.ts +++ b/docs/nuxt.config.ts @@ -98,6 +98,9 @@ export default defineNuxtConfig({ // the v2 to v3 guide lives with the v3 docs now '/docs/getting-started/migration/v3': { redirect: 'https://ui3.nuxt.com/getting-started/migration', prerender: false }, '/docs/getting-started/theme': { redirect: '/docs/getting-started/theme/design-system', prerender: false }, + // the Figma guide lives with the kit now; the docs entry is a link, not a page + '/figma': { redirect: { to: 'https://go.nuxt.com/figma-ui', statusCode: 301 }, prerender: false }, + '/docs/getting-started/figma': { redirect: { to: 'https://go.nuxt.com/figma-ui', statusCode: 301 }, prerender: false }, '/docs/getting-started/integrations': { redirect: '/docs/getting-started/integrations/icons', prerender: false }, '/docs/getting-started/ai': { redirect: '/docs/getting-started/ai/mcp', prerender: false }, '/docs/composables': { redirect: '/docs/composables/define-shortcuts', prerender: false }, @@ -274,6 +277,8 @@ export default defineNuxtConfig({ { path: '/', raw: '/raw/index.md' }, '/docs/**' ], + // the Figma entry links out (routeRules above), there is no page to list or serve + excludePrefixes: { extend: ['/docs/getting-started/figma'] }, sitemap: { markdown: { // Split `/docs/**` into a section per area; `/blog/**` stays whole. @@ -445,7 +450,9 @@ export default defineNuxtConfig({ title: 'Getting Started', contentCollection: 'docs', contentFilters: [ - { field: 'path', operator: 'LIKE', value: '/docs/getting-started%' } + { field: 'path', operator: 'LIKE', value: '/docs/getting-started%' }, + // an entry that links out (Figma) has no page to include + { field: 'to', operator: 'IS NULL' } ] }, { title: 'Components', diff --git a/docs/server/mcp/resources/documentation-pages.ts b/docs/server/mcp/resources/documentation-pages.ts index 4d1e9177b..d1fb17b5f 100644 --- a/docs/server/mcp/resources/documentation-pages.ts +++ b/docs/server/mcp/resources/documentation-pages.ts @@ -9,7 +9,8 @@ export default defineMcpResource({ const pages = await queryCollection(event, 'docs').all() - const result = pages.map(doc => ({ + // an entry with its own `to` (Figma) links out, there is no page to read + const result = pages.filter(doc => !doc.to).map(doc => ({ title: doc.title, description: doc.description, path: doc.path