Skip to content

Commit

Permalink
fda
Browse files Browse the repository at this point in the history
  • Loading branch information
neerajrekwar committed Aug 26, 2024
1 parent e942601 commit 98132e8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
7 changes: 0 additions & 7 deletions app/blog/[slug]/generateStaticParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,3 @@ export async function generateStaticParams() {
slug: post.slug, // Generate paths based on the `slug`
}));
}
export default function Page({ params }) {
const { slug } = params

return (
<div>{slug}</div>
)
}
6 changes: 3 additions & 3 deletions app/blog/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ interface BlogPostPageProps {
};
}

const BlogPostPage = ({ params }: BlogPostPageProps) => {
const post: BlogPost | undefined = posts.find((p) => p.slug === params.slug);
const BlogPostPage = ({ params }: { params: { slug: string } }) => {
const post = posts.find((p) => p.slug === params.slug);

if (!post) {
notFound(); // Return 404 if the post is not found
notFound(); // Return 404 if the post is not found
}
const formattedDate = new Date(post.date).toLocaleDateString('en-US', {
year: 'numeric',
Expand Down
2 changes: 1 addition & 1 deletion app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@import url('https://fonts.googleapis.com/css2?family=Caveat:[email protected]&display=swap');

:root {
--color-primary: #e6e6e6;
--color-primary: #ffffff;
--color-secondary: #242424;
--color-third: #2cffbf;
--color-four: #5e716a;
Expand Down

0 comments on commit 98132e8

Please sign in to comment.