import { Container } from "@/components/landing/container"; import { FadeIn } from "@/components/landing/fade-in"; import { MdxContent } from "@/components/landing/mdx-content"; // import { PageLinks } from "@/components/landing/page-links"; import { Avatar, AvatarImage } from "@/components/ui/avatar"; import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area"; import { authors } from "@/content/blog/authors"; import type { GetServerSideProps, Metadata } from "next"; import Link from "next/link"; import { notFound } from "next/navigation"; import { BLOG_PATH, getContentData, getFilePaths, getPost, getPostContent } from "@/lib/mdx-helper"; import service from "@/lib/http/service"; import { Header, NavBack, TimeP } from "@/components/header"; import { baseTitle, baseURL, keywordsRoot } from "@/lib/metadata"; import { useTranslation } from "react-i18next"; export const runtime = "nodejs"; type Props = { params: { locale: string, slug: string; title: string; description: string; authorName: string }; searchParams: { [key: string]: string | string[] | undefined }; }; export async function generateMetadata({ params }: Props): Promise { const { serialized, frontmatter, headings } = await getPostContent(params.locale, params.slug); console.log("2--------------------------generateMetadata-----------------------------", headings) if (!frontmatter) { return notFound(); } 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 ?? ""); return { title: `${frontmatter.title}`, description: frontmatter.description, keywords: keywordsRoot(headings.text || ""), openGraph: { title: `${frontmatter.title} | ${baseTitle}`, description: frontmatter.description, type: "article", images: [ { url: ogUrl.toString(), width: 1200, height: 630, alt: frontmatter.title, }, ], }, twitter: { card: "summary_large_image", title: `${frontmatter.title} | ${baseTitle}`, description: frontmatter.description, images: [ { url: ogUrl.toString(), width: 1200, height: 630, alt: frontmatter.title, }, ], }, icons: { shortcut: "/favicon.png", }, }; } const BlogArticleWrapper = async ({ params }: { params: { slug: string, locale: string, } }) => { const { serialized, frontmatter, headings } = await getPostContent(params.locale, params.slug); console.log("frontmatter", frontmatter) const defaultImage = "https://gimg3.baidu.com/search/src=http%3A%2F%2Fpics3.baidu.com%2Ffeed%2F4ec2d5628535e5dd7c7cdc23847e08e2cc1b62c4.jpeg%40f_auto%3Ftoken%3D38327d5cbefb2cd45af58f8d47c0a0b5&refer=http%3A%2F%2Fwww.baidu.com&app=2021&size=f360,240&n=0&g=0n&q=75&fmt=auto?sec=1710435600&t=eafc0a27ff3295bb5b0b9065fc33a523" return ( <>
Blog

>

{frontmatter.title}

{/*

All Blogs

*/} { frontmatter.tags && frontmatter.tags?.length > 0 && frontmatter.tags?.map((item, index) => { return

{item}

}) }
{/*

{} {t("JellyAI")}

*/}

{frontmatter.title}

{frontmatter.title}
); }; 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 && ( // // )} */} // // ); // };