Mount /vip with nomadvip+payjsapi, add @nomadro/pay|pb|sdk, apps/api, /admin shell, and backup/rollback scripts under git.nomadro.cn workflow. Co-authored-by: Cursor <cursoragent@cursor.com>
24 lines
947 B
TypeScript
24 lines
947 B
TypeScript
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 <EbookViewer data={data} config={config} />;
|
|
}
|