${escapeHtml(post.title)}
${escapeHtml(excerpt)}${excerpt.length >= 180 ? "…" : ""}
import { escapeHtml, escapeAttr, formatDateTime, cleanText, stripMarkdown, b64EncodeUtf8 } from "./utils.js"; const DEFAULT_SITE_NAME_ZH = "萌芽小窝"; const DEFAULT_SITE_NAME_EN = "SproutBlog"; export function siteNameZh(env) { return cleanText(env?.SITE_TITLE) || DEFAULT_SITE_NAME_ZH; } export function siteNameEn(env) { return cleanText(env?.SITE_TITLE_EN) || DEFAULT_SITE_NAME_EN; } export function pageTitle(env, suffix = "") { const site = siteNameZh(env); return suffix ? `${site} - ${suffix}` : site; } export function renderLayout(title, body, env, options = {}) { const siteZh = siteNameZh(env); const siteEn = siteNameEn(env); const cwdPostSlug = options.cwdPostSlug ? String(options.cwdPostSlug) : ""; const cwdApiBase = cleanText(env?.CWD_API_BASE) || "https://cwd.api.smyhub.com"; const cwdSiteId = cleanText(env?.CWD_SITE_ID); const cwdSection = cwdPostSlug ? `
${escapeHtml(excerpt)}${excerpt.length >= 180 ? "…" : ""}
ID: ${post.id} | Slug: ${escapeHtml(post.slug)} | ${post.published ? "已发布" : "草稿"} | ${formatDateTime(post.updated_at)}
加载中…
评论