feat: 友链/书库/移动端导航/排行榜等多模块功能
新增模块: - 友链(friendlink)后端处理 + 前端管理页与友链板 - 书库(library):导入、章节、封面、阅读页、横竖版自适应 AdaptiveCoverSlot - 顶栏导航(header_nav)配置与 MobileTabBar/MobileRailDrawers 移动端抽屉 - 排行榜 service 测试、站点页面测试、时间线发布(timeline_release) 其它改动: - 后端 handlers/services 全量小幅调整 - 前端组件、库函数、URL/品牌/站点 URL 工具更新 - Lightbox 图片、MdEntries 条目卡、coverColor 派生色相等前端能力
This commit is contained in:
@@ -8,6 +8,7 @@ import { expandDyEmojiShortcodes } from "@/lib/dyEmoji";
|
||||
import type { HideKind } from "@/lib/hideBlocks";
|
||||
import MdHideBlock from "@/components/markdown/MdHideBlock";
|
||||
import MdTimeline from "@/components/markdown/MdTimeline";
|
||||
import { MdEntriesView } from "@/components/markdown/MdEntries";
|
||||
|
||||
type MarkdownBodyClientProps = {
|
||||
content: string;
|
||||
@@ -16,10 +17,14 @@ type MarkdownBodyClientProps = {
|
||||
postId?: number;
|
||||
loginHref?: string;
|
||||
loggedIn?: boolean;
|
||||
/** 书级「全章节条目卡模式」:章节内容免写 [entries] 壳 */
|
||||
entriesAuto?: boolean;
|
||||
/** 按分段索引的条目标题锚点 id(与章内目录共享;阅读页传入,其他场景缺省) */
|
||||
entriesTitleIds?: (string[] | undefined)[];
|
||||
};
|
||||
|
||||
/**
|
||||
* 客户端 Markdown(发帖预览 / 评论):GFM + 隐藏块 / 时间线预览。
|
||||
* 客户端 Markdown(发帖预览 / 评论):GFM + 隐藏块 / 时间线 / 条目卡预览。
|
||||
*/
|
||||
export default function MarkdownBodyClient({
|
||||
content,
|
||||
@@ -28,8 +33,12 @@ export default function MarkdownBodyClient({
|
||||
postId,
|
||||
loginHref,
|
||||
loggedIn = false,
|
||||
entriesAuto = false,
|
||||
entriesTitleIds,
|
||||
}: MarkdownBodyClientProps) {
|
||||
const segs = splitContentSegments(expandDyEmojiShortcodes(content || ""));
|
||||
const segs = splitContentSegments(expandDyEmojiShortcodes(content || ""), {
|
||||
entriesAuto,
|
||||
});
|
||||
const mdComponents = mergeMarkdownComponents(components);
|
||||
// 时间线/隐藏块正文不套外层 heading 覆盖,避免预览与正文目录 id 错位
|
||||
const nestedMd = mergeMarkdownComponents();
|
||||
@@ -60,6 +69,20 @@ export default function MarkdownBodyClient({
|
||||
/>
|
||||
);
|
||||
}
|
||||
if (seg.type === "entries") {
|
||||
return (
|
||||
<MdEntriesView
|
||||
key={`entries-${i}`}
|
||||
items={seg.items}
|
||||
titleIds={entriesTitleIds?.[i]}
|
||||
renderMd={(t) => (
|
||||
<ReactMarkdown remarkPlugins={[remarkGfm]} components={nestedMd}>
|
||||
{expandDyEmojiShortcodes(t)}
|
||||
</ReactMarkdown>
|
||||
)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
const kind = seg.kind as HideKind;
|
||||
if (seg.locked) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user