Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…auri into website
  • Loading branch information
codad5 committed Jan 4, 2024
2 parents 5dfd617 + 8def93b commit 6ee0c53
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Metadata } from 'next';


export const generateStaticParams = () => {
const posts = getPostsAndMetadata('static-pages')
const posts = getPostsAndMetadata('./static-pages')
console.log(posts)
return posts.map((post) => ({
slug: post.slug
Expand All @@ -19,7 +19,7 @@ export const generateStaticParams = () => {

export async function generateMetadata({ params, searchParams }: { params: { slug: string }, searchParams: any }): Promise<Metadata> {
const { slug } = params;
const postContents = getPostMetadata(slug, 'static-pages')
const postContents = getPostMetadata(slug, './static-pages')
if(!postContents) return {};
const { title, date, description, tags, image } = postContents
return {
Expand Down Expand Up @@ -56,7 +56,7 @@ export async function generateMetadata({ params, searchParams }: { params: { slu
export default function StaticPage({ params }: { params: { slug: string } }) {
const { slug } = params;
console.log(slug, 'slug')
const postContents = getPostContent(slug, 'static-pages')
const postContents = getPostContent(slug, './static-pages')
if(!postContents) notFound()
const { content, data } = matter(postContents);
const { title, date, image , tags, description} = data as postsType
Expand Down

0 comments on commit 6ee0c53

Please sign in to comment.