Skip to content

Commit 05a8b1e

Browse files
authored
feat: trailingSlash to true (#71)
1 parent e248629 commit 05a8b1e

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

app/docs/[[...slug]]/page.tsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { mdxComponents } from "@/src/components/mdx-components";
22
import { docsSource } from "@/src/lib/source";
3-
import { MDXContent } from '@content-collections/mdx/react';
3+
import { MDXContent } from "@content-collections/mdx/react";
44
import { DocsBody, DocsDescription, DocsPage, DocsTitle } from "fumadocs-ui/page";
55
import { notFound } from "next/navigation";
66

@@ -15,25 +15,23 @@ export default async function Page(props: any) {
1515
if (!page) notFound();
1616

1717
const authors = page.data.authors || [];
18-
18+
1919
return (
2020
<DocsPage toc={page.data.toc} full={page.data.full}>
2121
<DocsTitle>{page.data.title}</DocsTitle>
2222
<DocsDescription>{page.data.description}</DocsDescription>
23-
{page.data.updatedAt ?
24-
<span className="text-sm text-gray-500">해당 글은 {page.data.updatedAt}에 수정되었습니다.</span> :
25-
page.data.createdAt ? <span className="text-sm text-gray-500">해당 글은 {page.data.createdAt}에 작성되었습니다.</span> : null
26-
}
23+
{page.data.updatedAt ? (
24+
<span className="text-sm text-gray-500">해당 글은 {page.data.updatedAt}에 수정되었습니다.</span>
25+
) : page.data.createdAt ? (
26+
<span className="text-sm text-gray-500">해당 글은 {page.data.createdAt}에 작성되었습니다.</span>
27+
) : null}
2728
<div className="flex gap-4">
2829
{authors.map((author) => (
2930
<Author key={author} name={author} />
3031
))}
3132
</div>
3233
<DocsBody>
33-
<MDXContent
34-
code={page.data.body}
35-
components={{ ...mdxComponents as MDXComponents }}
36-
/>
34+
<MDXContent code={page.data.body} components={{ ...(mdxComponents as MDXComponents) }} />
3735
</DocsBody>
3836
</DocsPage>
3937
);

next.config.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
import { withContentCollections } from '@content-collections/next';
1+
import { withContentCollections } from "@content-collections/next";
22

33
// const withMDX = createMDX();
44

55
/** @type {import('next').NextConfig} */
66
const config = {
7-
output: 'export',
7+
output: "export",
88
reactStrictMode: true,
9+
trailingSlash: true,
910
images: { unoptimized: true },
1011
webpack: (config) => {
1112
config.module.rules.push({
1213
test: /\.ya?ml$/,
13-
use: 'yaml-loader',
14+
use: "yaml-loader",
1415
});
1516
return config;
1617
},

0 commit comments

Comments
 (0)