diff --git a/apps/blogai/app/[locale]/blog/[slug]/page.tsx b/apps/blogai/app/[locale]/blog/[slug]/page.tsx index b3d3722..468409a 100644 --- a/apps/blogai/app/[locale]/blog/[slug]/page.tsx +++ b/apps/blogai/app/[locale]/blog/[slug]/page.tsx @@ -27,7 +27,7 @@ export async function generateMetadata({ params }: Props): Promise { const { serialized, frontmatter, headings } = await getPostContent(params.locale, params.slug); - console.log("---------------------------generateMetadata-----------------------------", headings) + console.log("2--------------------------generateMetadata-----------------------------", headings) if (!frontmatter) { return notFound(); diff --git a/apps/blogai/app/[locale]/qa/[slug]/page.tsx b/apps/blogai/app/[locale]/qa/[slug]/page.tsx index 2285c8a..68ea4d6 100644 --- a/apps/blogai/app/[locale]/qa/[slug]/page.tsx +++ b/apps/blogai/app/[locale]/qa/[slug]/page.tsx @@ -23,39 +23,20 @@ type Props = { }; export async function generateMetadata({ params }: Props): Promise { - // export async function generateMetadata(ctx: any): Promise { - // read route params - // const { frontmatter } = await getPost(params.slug); const { serialized, frontmatter, headings } = await getQAContent(params.locale, params.slug); - console.log("---generateMetadata---", headings) - - // const { - // serialized, - // frontmatter, - // headings, - // } = ctx + console.log("1------------------------generateMetadata----------------------------", headings) if (!frontmatter) { return notFound(); } - // const baseUrl = process.env.VERCEL_URL ? "https://jellyai.xyz" : "http://localhost:3000"; const baseUrl = process.env.VERCEL_URL ? process.env.VERCEL_URL : baseURL; const ogUrl = new URL("/og/blog", baseUrl); const author = authors[frontmatter.author]; ogUrl.searchParams.set("title", frontmatter.title ?? ""); - // ogUrl.searchParams.set("author", author.name ?? ""); - // if (author.image.src) { - // ogUrl.searchParams.set("image", new URL(author.image.src, baseUrl).toString()); - // } - return { - // title: { - // default: 'JellyAI', - // template: `${frontmatter.title} | JellyAI` - // }, title: `${frontmatter.title}`, description: frontmatter.description, category: `${headings.text}`, @@ -63,7 +44,6 @@ export async function generateMetadata({ params }: Props): Promise { openGraph: { title: `${frontmatter.title} | ${baseTitle}`, description: frontmatter.description, - // url: `https://unkey.dev/blog/${params.slug}`, type: "article", images: [ { @@ -73,7 +53,6 @@ export async function generateMetadata({ params }: Props): Promise { alt: frontmatter.title, }, ], - // siteName: "unkey.dev", }, twitter: { card: "summary_large_image", @@ -87,8 +66,6 @@ export async function generateMetadata({ params }: Props): Promise { alt: frontmatter.title, }, ], - // site: "@aigxion", - // creator: "@aigxion", }, icons: { shortcut: "/favicon.png", @@ -97,20 +74,9 @@ export async function generateMetadata({ params }: Props): Promise { } const BlogArticleWrapper = async ({ params }: { params: { slug: string, locale: string, } }) => { - // const BlogArticleWrapper = async (ctx: any) => { - // console.log(ctx) - // const { - // serialized, - // frontmatter, - // headings, - // } = ctx - const { serialized, frontmatter, headings } = await getQAContent(params.locale, params.slug); - // console.log(serialized, frontmatter, headings, params.slug) - // console.log(params.slug) - console.log("frontmatter", frontmatter) @@ -148,146 +114,6 @@ const BlogArticleWrapper = async ({ params }: { params: { slug: string, locale: ); - }; export default BlogArticleWrapper; - - - -// const BlogArticleWrapper_bak = async ({ params }: { params: { slug: string } }) => { -// const { serialized, frontmatter, headings } = await getPost(params.slug); -// console.log(serialized, frontmatter, headings, params.slug) - - -// const author = authors[frontmatter.author]; -// const moreArticles = await getContentData({ -// contentPath: BLOG_PATH, -// filepath: params.slug, -// }); - - -// return ( -// <> -// -//
-//
-//

-// {frontmatter.title} -//

-//

{frontmatter.description}

-//
-// -//
-//
- -//
-//
-// -// -// -//
-//
{author.name}
-//
-//
-// { -//
-//

-// Table of Contents -//

-// -//
-// {headings.map((heading) => { -// return ( -// -// ); -// })} -//
-// -//
-//
-// } -//
-//
-//
-// -//
-//
-// -//
-//

-// Accelerate your API development -//

- -//
-// -// Get started -// -// -// Documentation -// -//
-//
-//
-// App screenshot -//
-//
-//
-//
- -// {/* {moreArticles.length > 0 && ( -// -// )} */} -// -// ); -// }; \ No newline at end of file