Skip to content

Commit

Permalink
fix(pages): fix slug page
Browse files Browse the repository at this point in the history
  • Loading branch information
nfroidure committed Aug 23, 2023
1 parent 9163ccb commit 34db365
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pages/[...slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ const Page = ({ entry }: Props) => {
export default Page;

export const getStaticPaths: GetStaticPaths = async () => {
const paths = (await readDir(pathJoin(".", "contents", "pages"))).map(
(path) => {
const paths = (await readDir(pathJoin(".", "contents", "pages")))
.filter((file) => file !== "index.md")
.map((path) => {
const slug = path.replace(".md", "").split("/");

if (slug[slug.length - 1] === "index") {
Expand All @@ -60,8 +61,7 @@ export const getStaticPaths: GetStaticPaths = async () => {
return {
params: { slug },
};
}
);
});

return { paths, fallback: false };
};
Expand Down

0 comments on commit 34db365

Please sign in to comment.