import { readFileSync } from "fs"; import { parseEbookMarkdown, estimateReadingMinutes } from "@vip/lib/content/ebook"; import { EbookViewer } from "@vip/app/components/content/EbookViewer"; import { EBOOK_CONFIG } from "@vip/config/content.config"; import { resolveVipDataFile } from "@vip/app/lib/resolveVipDataFile"; export const metadata = { title: "电子书 | 数字游民", description: "数字游民:地理套利与自动化杠杆,低成本工作室、云手机、无人直播、出海掘金。", }; export default function EbookPage() { const mdPath = resolveVipDataFile("ebook.md"); const source = readFileSync(mdPath, "utf-8"); const data = parseEbookMarkdown(source); const textLen = data.chunks.reduce((s, c) => s + c.html.replace(/<[^>]+>/g, "").length, 0); const config = { ...EBOOK_CONFIG, estimatedMinutes: estimateReadingMinutes(textLen), }; return ; }