This commit is contained in:
hailin 2025-03-25 14:41:12 +08:00
parent 22b4f1855e
commit 812b9da818
3 changed files with 7 additions and 1 deletions

View File

@ -89,7 +89,7 @@ const BlogArticleWrapper = async ({ params }: { params: { slug: string, locale:
<DetailPageHeader <DetailPageHeader
data={{ data={{
icon: "🚀", icon: "🚀",
name: frontmatter.title, name: frontmatter.p_name,
category: frontmatter.tags, category: frontmatter.tags,
updated_at: frontmatter.date, updated_at: frontmatter.date,
company: frontmatter.title, company: frontmatter.title,

View File

@ -40,6 +40,7 @@ export interface ArticleData {
id: number; id: number;
org_id: number; org_id: number;
spider_id: number; spider_id: number;
pname: string;
tag: string; tag: string;
category: string; category: string;
main_title: string; main_title: string;
@ -50,6 +51,7 @@ export interface ArticleData {
tags: string[]; tags: string[];
url: string; url: string;
image_url: string; image_url: string;
logo_url: string;
content: string; content: string;
is_hotspot: boolean; is_hotspot: boolean;
is_overwritten: boolean; is_overwritten: boolean;

View File

@ -107,11 +107,13 @@ type Frontmatter = {
}; };
type AIFrontmatter = { type AIFrontmatter = {
p_name:string;
title: string; title: string;
date: string; date: string;
description: string; description: string;
author: string; author: string;
image_url: string; image_url: string;
logo_url: string;
visible: boolean | undefined; visible: boolean | undefined;
salary: string | undefined; salary: string | undefined;
level: string | undefined; level: string | undefined;
@ -279,11 +281,13 @@ export const getPostContent = async (language: string, slug: string): Promise<AI
// Serialize the MDX content and parse the frontmatter // Serialize the MDX content and parse the frontmatter
const serialized = await mdxSerialized({ rawMdx }); const serialized = await mdxSerialized({ rawMdx });
const frontmatter = serialized.frontmatter as AIFrontmatter; const frontmatter = serialized.frontmatter as AIFrontmatter;
frontmatter.p_name = data.pname
frontmatter.title = data.main_title frontmatter.title = data.main_title
frontmatter.description = data.sub_title || data.main_title frontmatter.description = data.sub_title || data.main_title
frontmatter.date = data.updated_time frontmatter.date = data.updated_time
frontmatter.tags = data.tags frontmatter.tags = data.tags
frontmatter.image_url = data.image_url frontmatter.image_url = data.image_url
frontmatter.logo_url = data.logo_url
// const headings = data.main_title; // const headings = data.main_title;