File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { splitMarkdown } from "./splitMarkdown";
77import { PageContent } from "./pageContent" ;
88import { ChatHistoryProvider } from "./chatHistory" ;
99import { getChatFromCache } from "@/lib/chatHistory" ;
10- import { getLanguageName } from "@/pagesList" ;
10+ import { getLanguageName , pagesList } from "@/pagesList" ;
1111
1212async function getMarkdownContent ( docs_id : string ) : Promise < string > {
1313 try {
@@ -61,6 +61,14 @@ export default async function Page({
6161} ) {
6262 const { docs_id } = await params ;
6363
64+ if (
65+ ! pagesList
66+ . find ( ( lang ) => docs_id . startsWith ( `${ lang . id } -` ) )
67+ ?. pages . find ( ( page ) => docs_id . endsWith ( `-${ page . id } ` ) )
68+ ) {
69+ notFound ( ) ;
70+ }
71+
6472 const mdContent = getMarkdownContent ( docs_id ) ;
6573 const splitMdContent = mdContent . then ( ( text ) => splitMarkdown ( text ) ) ;
6674 const initialChatHistories = getChatFromCache ( docs_id ) ;
You can’t perform that action at this time.
0 commit comments