#!/usr/bin/env node /** * 生成公众号草稿底部 layout 样板页(阅读原文引导 + TKMind 关注二维码)。 * * 用法: * node scripts/preview-wechat-draft-layout.mjs [publicUrl] [outputPath] */ import fs from 'node:fs/promises'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; import { applyWechatDraftArticleLayout, resolveMpFollowQrcodePublicUrl, } from '../wechat-draft-article-layout.mjs'; const root = path.join(path.dirname(fileURLToPath(import.meta.url)), '..'); const userId = '1c99b83b-0454-474f-a5d2-129d34506a32'; const defaultPublicUrl = `https://m.tkmind.cn/MindSpace/${userId}/public/august-afternoon.html`; async function loadSampleBody() { const samplePath = path.join(root, 'MindSpace', userId, 'public', 'august-afternoon.html'); try { const html = await fs.readFile(samplePath, 'utf8'); const titleMatch = html.match(/