2 Commits

Author SHA1 Message Date
68fae2e29e Merge remote-tracking branch 'origin/master'
All checks were successful
Deploy / deploy (ubuntu-latest, 2.44.0) (push) Successful in 1m4s
2024-10-07 20:06:18 -04:00
be319a4d7b fix the root docs page not working
Took 4 minutes
2024-10-07 20:06:04 -04:00

View File

@ -26,15 +26,16 @@ const DocsPage = async ({
}: { }: {
params: Promise<{ slug: string[] }>; params: Promise<{ slug: string[] }>;
}): Promise<ReactElement> => { }): Promise<ReactElement> => {
const slug: string = decodeURIComponent( const slug: string = (((await params).slug as string[]) || undefined)?.join(
(((await params).slug as string[]) || undefined)?.join("/") "/"
); );
// Get the content to display based on the provided slug // Get the content to display based on the provided slug
const pages: DocsContentMetadata[] = getDocsContent(); const pages: DocsContentMetadata[] = getDocsContent();
const decodedSlug: string = decodeURIComponent(slug || "");
const page: DocsContentMetadata | undefined = pages.find( const page: DocsContentMetadata | undefined = pages.find(
(metadata: DocsContentMetadata): boolean => (metadata: DocsContentMetadata): boolean =>
metadata.slug === (slug || "intro") metadata.slug === (decodedSlug || "intro")
); );
if (!page) { if (!page) {
notFound(); notFound();