diff --git a/apps/frontpage/app/docs-all/sitemap.ts b/apps/frontpage/app/docs-all/sitemap.ts index 33ea1df6..cc08c7c0 100644 --- a/apps/frontpage/app/docs-all/sitemap.ts +++ b/apps/frontpage/app/docs-all/sitemap.ts @@ -1,5 +1,5 @@ import { MetadataRoute } from 'next'; -import { generateDocsTree } from '../../lib/get-tree'; +import { getDocsTreeFromPath } from '../../lib/get-docs-tree-from-path'; import { docsVersions } from '@repo/utils'; import { FlatTreeNode, @@ -12,7 +12,7 @@ export default function sitemap(): MetadataRoute.Sitemap { const listofTrees = docsVersions.map((version) => { return { version: version, - tree: generateDocsTree(`content/docs/${version.id}`), + tree: getDocsTreeFromPath(`content/docs/${version.id}`), }; }); diff --git a/apps/frontpage/app/docs/[[...slug]]/page.tsx b/apps/frontpage/app/docs/[[...slug]]/page.tsx index b991457f..03f0d903 100644 --- a/apps/frontpage/app/docs/[[...slug]]/page.tsx +++ b/apps/frontpage/app/docs/[[...slug]]/page.tsx @@ -1,12 +1,12 @@ import { notFound, redirect } from 'next/navigation'; import Link from 'next/link'; import type { TreeProps } from '@repo/utils'; -import { GLOBAL_SEARCH_META_KEYS, GLOBAL_SEARCH_IMPORTANCE } from '@repo/ui'; +import { globalSearchMetaKeys, globalSearchImportance } from '@repo/ui'; import { latestVersion, cn } from '@repo/utils'; import { getVersion } from '../../../lib/get-version'; import { getPageData } from '../../../lib/get-page'; import { Renderers } from '../../../components/docs/renderers'; -import { generateDocsTree } from '../../../lib/get-tree'; +import { getDocsTreeFromPath } from '../../../lib/get-docs-tree-from-path'; import { DocsFooter } from '../../../components/docs/footer/footer'; import { Metadata } from 'next'; import { TableOfContent } from '../../../components/docs/table-of-content'; @@ -27,8 +27,8 @@ export async function generateMetadata({ description: "Storybook is a frontend workshop for building UI components and pages in isolation. Thousands of teams use it for UI development, testing, and documentation. It's open source and free.", other: { - [GLOBAL_SEARCH_META_KEYS.VERSION]: activeVersion.id, - [GLOBAL_SEARCH_META_KEYS.IMPORTANCE]: GLOBAL_SEARCH_IMPORTANCE.DOCS, + [globalSearchMetaKeys.version]: activeVersion.id, + [globalSearchMetaKeys.importance]: globalSearchImportance.docs, }, }; } @@ -37,7 +37,7 @@ const latestVersionId = latestVersion.id; export const generateStaticParams = () => { const result: { slug: string[] }[] = []; - const tree = generateDocsTree(); + const tree = getDocsTreeFromPath(); const getSlugs = (data: TreeProps[]) => { data.forEach((item) => { @@ -86,10 +86,10 @@ export default async function Page({ params: { slug } }: PageProps) { return ( <> -