File tree Expand file tree Collapse file tree 3 files changed +30
-2
lines changed
Expand file tree Collapse file tree 3 files changed +30
-2
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 {
@@ -54,6 +54,20 @@ export async function generateMetadata({
5454 } ;
5555}
5656
57+ export function generateStaticParams ( ) {
58+ // 存在するページのリストを返す https://nextjs.org/docs/app/api-reference/functions/generate-static-params
59+ return pagesList . reduce (
60+ ( acc , page ) => {
61+ page . pages . forEach ( ( p ) => {
62+ acc . push ( { docs_id : `${ page . id } -${ p . id } ` } ) ;
63+ } ) ;
64+ return acc ;
65+ } ,
66+ [ ] as { docs_id : string } [ ]
67+ ) ;
68+ }
69+ export const dynamicParams = false ;
70+
5771export default async function Page ( {
5872 params,
5973} : {
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export default function RootLayout({
2727 { /* mocha.css がbodyに背景色などを設定してしまうので、それを上書きしている */ }
2828 < AutoAnonymousLogin />
2929 < SidebarMdProvider >
30- < div className = "drawer lg:drawer-open" >
30+ < div className = "drawer lg:drawer-open min-h-screen " >
3131 < input
3232 id = "drawer-toggle"
3333 type = "checkbox"
Original file line number Diff line number Diff line change 1+ import Link from "next/link" ;
2+
3+ export default function NotFound ( ) {
4+ return (
5+ < div className = "p-4 flex-1 flex flex-col items-center justify-center" >
6+ < h1 className = "text-2xl font-bold mb-4" > 404</ h1 >
7+ < p > 指定されたページが見つかりません。</ p >
8+ < div className = "divider w-80 max-w-full self-auto!" />
9+ < Link href = "/" className = "btn btn-primary" >
10+ トップに戻る
11+ </ Link >
12+ </ div >
13+ ) ;
14+ }
You can’t perform that action at this time.
0 commit comments