--- import * as fs from "node:fs"; import * as path from "node:path"; import { footerConfig, profileConfig } from "../config"; import { url } from "../utils/url-utils"; const currentYear = new Date().getFullYear(); // 页脚自定义内容逻辑 let customFooterHtml = ""; if (footerConfig.enable) { // 优先使用 customHtml,如果为空则使用 FooterConfig.html 文件内容 if (footerConfig.customHtml && footerConfig.customHtml.trim() !== "") { customFooterHtml = footerConfig.customHtml.trim(); } else { // customHtml 为空时,读取 FooterConfig.html 文件内容 try { const footerConfigPath = path.join( process.cwd(), "src", "FooterConfig.html", ); customFooterHtml = fs.readFileSync(footerConfigPath, "utf-8"); // 移除HTML注释 customFooterHtml = customFooterHtml .replace(//g, "") .trim(); } catch (error) { console.warn("FooterConfig.html文件读取失败:", error.message); } } } ---