Skip to content

Commit

Permalink
[templates/d,flowershow#1][s]: home page runs off markdown content/in…
Browse files Browse the repository at this point in the history
…dex.md rather than pages/index.js.

* Convert from catch-all route to optional catch-all route.
  • Loading branch information
rufuspollock committed Jun 24, 2022
1 parent ab7db73 commit 4a95981
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
3 changes: 3 additions & 0 deletions templates/default/content/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Flowershow Default Template

## A starter template for Next.JS with Tailwind and MDX
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export default function Page({ body, ...rest }) {
}

export async function getStaticProps({ params }) {
const urlPath = params.slug.join("/");
// params.slug is undefined for root index page
const urlPath = params.slug ? params.slug.join("/") : '';
const page = allPages.find((p) => p.url === urlPath);
return { props: page };
}
Expand Down
18 changes: 0 additions & 18 deletions templates/default/pages/index.js

This file was deleted.

0 comments on commit 4a95981

Please sign in to comment.