refactor: 播放器与 Love 页重构(无限 Marquee、统一章节标题、时间轴手动翻页)
This commit is contained in:
+15
-1
@@ -7,6 +7,7 @@ import { aboutProfile } from "@/mock/about";
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
let title = "春风不解别离意,今日方知我是春。";
|
||||
let authorName = "RRTiamo";
|
||||
try {
|
||||
const response = await getPublicConfig();
|
||||
const configs = response.data?.data;
|
||||
@@ -18,6 +19,19 @@ export async function generateMetadata(): Promise<Metadata> {
|
||||
if (titleConfig?.configValue) {
|
||||
title = titleConfig.configValue;
|
||||
}
|
||||
// 作者名取自身份档案聚合键(about_* 关系表拼装),缺失时回退默认值
|
||||
const profileConfig = configs.find(
|
||||
(item: { configKey?: string; configValue?: string }) =>
|
||||
item.configKey === "page.about.profile"
|
||||
);
|
||||
if (profileConfig?.configValue) {
|
||||
try {
|
||||
const profile = JSON.parse(profileConfig.configValue);
|
||||
if (profile?.name) authorName = profile.name;
|
||||
} catch {
|
||||
// blob 解析失败时保持默认名
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn("Failed to generate About page metadata:", error);
|
||||
@@ -25,7 +39,7 @@ export async function generateMetadata(): Promise<Metadata> {
|
||||
|
||||
return {
|
||||
title,
|
||||
description: "我在代码、文字和生活的缝隙里,慢慢搭建一个属于自己的小宇宙。关于 RRTiamo,此间主人。",
|
||||
description: `我在代码、文字和生活的缝隙里,慢慢搭建一个属于自己的小宇宙。关于 ${authorName},此间主人。`,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user