Skip to content

Commit

Permalink
update pages
Browse files Browse the repository at this point in the history
  • Loading branch information
sadmann7 committed Dec 7, 2023
1 parent ab17d91 commit 77ebd23
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# editorconfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
17 changes: 16 additions & 1 deletion src/app/(lobby)/(content)/pages/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,17 @@ export default function Page({ params }: PageProps) {
notFound()
}

// Remove the /pages prefix from the slug
const formattedPage = {
...page,
slug: page.slug.replace(/^\/pages/, ""),
}

const formattedPages = allPages.map((page) => ({
...page,
slug: page.slug.replace(/^\/pages/, ""),
}))

return (
<Shell as="article" variant="markdown">
<PageHeader>
Expand All @@ -95,7 +106,11 @@ export default function Page({ params }: PageProps) {
</PageHeader>
<Separator className="my-4" />
<Mdx code={page.body.code} />
<MdxPager currentItem={page} allItems={allPages} className="my-4" />
<MdxPager
currentItem={formattedPage}
allItems={formattedPages}
className="my-4"
/>
</Shell>
)
}
8 changes: 4 additions & 4 deletions src/config/site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,22 @@ export const siteConfig = {
items: [
{
title: "About",
href: "/about",
href: "/pages/about",
external: false,
},
{
title: "Contact",
href: "/legal/Contact",
href: "/pages/Contact",
external: false,
},
{
title: "Terms",
href: "/legal/terms",
href: "/pages/terms",
external: false,
},
{
title: "Privacy",
href: "/legal/privacy",
href: "/pages/privacy",
external: false,
},
],
Expand Down

1 comment on commit 77ebd23

@vercel
Copy link

@vercel vercel bot commented on 77ebd23 Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.