[{"data":1,"prerenderedAt":562},["ShallowReactive",2],{"note:/notes/static-site-release-checks":3,"notes-summary":490},[4],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9,"description":10,"updated":11,"category":12,"body":13,"_type":483,"_id":484,"_source":485,"_file":486,"_stem":487,"_extension":488,"sitemap":489},"/notes/static-site-release-checks","notes",false,"","静态官网构建成功了，为什么还要检查生成的 HTML？","以翼程官网的 Markdown 发文流程为例，说明如何检查静态正文、导航、规范链接与站点地图，以及哪些错误要到部署后才能发现。","2026-11-19","开发心得",{"type":14,"children":15,"toc":479},"root",[16,41,47,67,190,231,284,290,303,418,461,473],{"type":17,"tag":18,"props":19,"children":20},"element","p",{},[21,24,31,33,39],{"type":22,"value":23},"text","写完一篇 Markdown 文章，本地开发服务器能打开，",{"type":17,"tag":25,"props":26,"children":28},"code",{"className":27},[],[29],{"type":22,"value":30},"npm run generate",{"type":22,"value":32}," 也没报错，是不是就能直接把文件传上服务器了？还真不一定。我们遇到过一种情况：构建命令正常退出，传上去之后从列表页点进新文章，出来的却是个空白壳子。原因在于本地开发服务器是现场读 Markdown，而线上静态服务器只管把构建时生成的 ",{"type":17,"tag":25,"props":34,"children":36},{"className":35},[],[37],{"type":22,"value":38},".output/public",{"type":22,"value":40}," 原样发给浏览器。如果在预渲染阶段漏了路由或数据没挂上，光看终端里的构建成功提示是看不出来的，得直接去查生成出来的那堆 HTML 文件。",{"type":17,"tag":42,"props":43,"children":45},"h2",{"id":44},"先确认一篇文章三处都能找到",[46],{"type":22,"value":44},{"type":17,"tag":18,"props":48,"children":49},{},[50,52,57,59,65],{"type":22,"value":51},"翼程官网每次发布前，都会先跑 ",{"type":17,"tag":25,"props":53,"children":55},{"className":54},[],[56],{"type":22,"value":30},{"type":22,"value":58},"，紧接着跑 ",{"type":17,"tag":25,"props":60,"children":62},{"className":61},[],[63],{"type":22,"value":64},"npm run seo:check",{"type":22,"value":66},"。针对每一篇笔记，脚本会交叉核对三个地方：",{"type":17,"tag":68,"props":69,"children":70},"ol",{},[71,131,149],{"type":17,"tag":72,"props":73,"children":74},"li",{},[75,81,83,89,91,97,99,105,107,113,115,121,123,129],{"type":17,"tag":76,"props":77,"children":78},"strong",{},[79],{"type":22,"value":80},"详情 HTML。",{"type":22,"value":82}," 按文章路径去 ",{"type":17,"tag":25,"props":84,"children":86},{"className":85},[],[87],{"type":22,"value":88},".output/public/notes/",{"type":22,"value":90}," 下找对应的 ",{"type":17,"tag":25,"props":92,"children":94},{"className":93},[],[95],{"type":22,"value":96},"index.html",{"type":22,"value":98},"（或 ",{"type":17,"tag":25,"props":100,"children":102},{"className":101},[],[103],{"type":22,"value":104},".html",{"type":22,"value":106},"），打开看 ",{"type":17,"tag":25,"props":108,"children":110},{"className":109},[],[111],{"type":22,"value":112},"\u003Ctitle>",{"type":22,"value":114},"、",{"type":17,"tag":25,"props":116,"children":118},{"className":117},[],[119],{"type":22,"value":120},"\u003Ch1>",{"type":22,"value":122}," 和 ",{"type":17,"tag":25,"props":124,"children":126},{"className":125},[],[127],{"type":22,"value":128},".note-body",{"type":22,"value":130}," 正文是不是真的渲染进去了，防住「文件生成了，但里面是个空壳」的情况。",{"type":17,"tag":72,"props":132,"children":133},{},[134,139,141,147],{"type":17,"tag":76,"props":135,"children":136},{},[137],{"type":22,"value":138},"栏目链接。",{"type":22,"value":140}," 去栏目列表页的 HTML 里找指向这篇文章的 ",{"type":17,"tag":25,"props":142,"children":144},{"className":143},[],[145],{"type":22,"value":146},"\u003Ca href>",{"type":22,"value":148},"，再顺着链接确认目标文件确实存在。不然文章就算生成了，访客从栏目首页点不进去，也成了孤岛页。",{"type":17,"tag":72,"props":150,"children":151},{},[152,157,159,165,167,173,175,181,182,188],{"type":17,"tag":76,"props":153,"children":154},{},[155],{"type":22,"value":156},"站点地图和规范网址。",{"type":22,"value":158}," 比对 ",{"type":17,"tag":25,"props":160,"children":162},{"className":161},[],[163],{"type":22,"value":164},"sitemap.xml",{"type":22,"value":166}," 里的 ",{"type":17,"tag":25,"props":168,"children":170},{"className":169},[],[171],{"type":22,"value":172},"\u003Cloc>",{"type":22,"value":174},"、详情页 ",{"type":17,"tag":25,"props":176,"children":178},{"className":177},[],[179],{"type":22,"value":180},"\u003Chead>",{"type":22,"value":166},{"type":17,"tag":25,"props":183,"children":185},{"className":184},[],[186],{"type":22,"value":187},"canonical",{"type":22,"value":189}," 和实际路径，重点查域名对不对、有没有多出尾斜杠，以及已经删掉的旧页面是不是还留在列表里。",{"type":17,"tag":18,"props":191,"children":192},{},[193,195,200,202,207,209,215,217,222,224,229],{"type":22,"value":194},"这里有个很容易踩的盲区：如果校验脚本只顺着 ",{"type":17,"tag":25,"props":196,"children":198},{"className":197},[],[199],{"type":22,"value":164},{"type":22,"value":201}," 里的地址去查 HTML，那万一某篇新文章既漏了预渲染 HTML、又没进 ",{"type":17,"tag":25,"props":203,"children":205},{"className":204},[],[206],{"type":22,"value":164},{"type":22,"value":208},"，脚本把已知地址查完一遍，居然也能报「全部通过」。所以我们的做法是先直接读取 ",{"type":17,"tag":25,"props":210,"children":212},{"className":211},[],[213],{"type":22,"value":214},"content/notes/",{"type":22,"value":216}," 目录下的公开 Markdown 文件，算出",{"type":17,"tag":76,"props":218,"children":219},{},[220],{"type":22,"value":221},"应该发布哪些文章地址",{"type":22,"value":223},"，先拿这份清单跟 ",{"type":17,"tag":25,"props":225,"children":227},{"className":226},[],[228],{"type":22,"value":164},{"type":22,"value":230}," 对账，再去逐个查 HTML。这样只要漏掉一篇，构建当场就会报错退出。",{"type":17,"tag":18,"props":232,"children":233},{},[234,236,242,244,249,251,257,259,264,266,275,277],{"type":22,"value":235},"另外，站内约定直接拿文章头部的 ",{"type":17,"tag":25,"props":237,"children":239},{"className":238},[],[240],{"type":22,"value":241},"updated",{"type":22,"value":243}," 当作页面更新日期，并跟 ",{"type":17,"tag":25,"props":245,"children":247},{"className":246},[],[248],{"type":22,"value":164},{"type":22,"value":250}," 的 ",{"type":17,"tag":25,"props":252,"children":254},{"className":253},[],[255],{"type":22,"value":256},"\u003Clastmod>",{"type":22,"value":258}," 核对。改了哪篇，就只改哪篇的 ",{"type":17,"tag":25,"props":260,"children":262},{"className":261},[],[263],{"type":22,"value":241},{"type":22,"value":265},"；重新打包整站时，没动过的老文章日期保持原样，不拿构建当天的日期去冒充内容更新时间。 ",{"type":17,"tag":267,"props":268,"children":272},"a",{"href":269,"rel":270},"https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap",[271],"nofollow",[273],{"type":22,"value":274},"Google Search Central 的 Sitemap 指南",{"type":22,"value":276}," · ",{"type":17,"tag":267,"props":278,"children":281},{"href":279,"rel":280},"https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls",[271],[282],{"type":22,"value":283},"规范网址说明",{"type":17,"tag":42,"props":285,"children":287},{"id":286},"部署之后用两个地址检查服务器",[288],{"type":22,"value":289},"部署之后，用两个地址检查服务器",{"type":17,"tag":18,"props":291,"children":292},{},[293,295,301],{"type":22,"value":294},"本地的静态产物检查只能管到文件打包这一步。文件传到线上服务器以后，访客请求某个网址到底返回什么，还得看 Nginx 或 CDN 的路由、重写和缓存是怎么配的。每次发完版，用 ",{"type":17,"tag":25,"props":296,"children":298},{"className":297},[],[299],{"type":22,"value":300},"curl",{"type":22,"value":302}," 测两个地址最稳妥：一个是刚发上去的新文章地址，另一个是肯定不存在的假地址。",{"type":17,"tag":304,"props":305,"children":309},"pre",{"className":306,"code":307,"language":308,"meta":8,"style":8},"language-bash shiki shiki-themes github-dark","# 将示例域名与路径换成实际站点和刚发布的文章地址，预期返回 200。\ncurl -sS -o /dev/null -w '%{http_code}\\n' https://example.com/notes/new-article\n\n# 请求一个确认不存在的地址，预期返回 404。\ncurl -sS -o /dev/null -w '%{http_code}\\n' https://example.com/notes/this-page-does-not-exist\n","bash",[310],{"type":17,"tag":25,"props":311,"children":312},{"__ignoreMap":8},[313,325,366,376,385],{"type":17,"tag":314,"props":315,"children":318},"span",{"class":316,"line":317},"line",1,[319],{"type":17,"tag":314,"props":320,"children":322},{"style":321},"--shiki-default:#6A737D",[323],{"type":22,"value":324},"# 将示例域名与路径换成实际站点和刚发布的文章地址，预期返回 200。\n",{"type":17,"tag":314,"props":326,"children":328},{"class":316,"line":327},2,[329,334,340,345,351,356,361],{"type":17,"tag":314,"props":330,"children":332},{"style":331},"--shiki-default:#B392F0",[333],{"type":22,"value":300},{"type":17,"tag":314,"props":335,"children":337},{"style":336},"--shiki-default:#79B8FF",[338],{"type":22,"value":339}," -sS",{"type":17,"tag":314,"props":341,"children":342},{"style":336},[343],{"type":22,"value":344}," -o",{"type":17,"tag":314,"props":346,"children":348},{"style":347},"--shiki-default:#9ECBFF",[349],{"type":22,"value":350}," /dev/null",{"type":17,"tag":314,"props":352,"children":353},{"style":336},[354],{"type":22,"value":355}," -w",{"type":17,"tag":314,"props":357,"children":358},{"style":347},[359],{"type":22,"value":360}," '%{http_code}\\n'",{"type":17,"tag":314,"props":362,"children":363},{"style":347},[364],{"type":22,"value":365}," https://example.com/notes/new-article\n",{"type":17,"tag":314,"props":367,"children":369},{"class":316,"line":368},3,[370],{"type":17,"tag":314,"props":371,"children":373},{"emptyLinePlaceholder":372},true,[374],{"type":22,"value":375},"\n",{"type":17,"tag":314,"props":377,"children":379},{"class":316,"line":378},4,[380],{"type":17,"tag":314,"props":381,"children":382},{"style":321},[383],{"type":22,"value":384},"# 请求一个确认不存在的地址，预期返回 404。\n",{"type":17,"tag":314,"props":386,"children":388},{"class":316,"line":387},5,[389,393,397,401,405,409,413],{"type":17,"tag":314,"props":390,"children":391},{"style":331},[392],{"type":22,"value":300},{"type":17,"tag":314,"props":394,"children":395},{"style":336},[396],{"type":22,"value":339},{"type":17,"tag":314,"props":398,"children":399},{"style":336},[400],{"type":22,"value":344},{"type":17,"tag":314,"props":402,"children":403},{"style":347},[404],{"type":22,"value":350},{"type":17,"tag":314,"props":406,"children":407},{"style":336},[408],{"type":22,"value":355},{"type":17,"tag":314,"props":410,"children":411},{"style":347},[412],{"type":22,"value":360},{"type":17,"tag":314,"props":414,"children":415},{"style":347},[416],{"type":22,"value":417}," https://example.com/notes/this-page-does-not-exist\n",{"type":17,"tag":18,"props":419,"children":420},{},[421,423,429,431,436,438,444,446,452,454],{"type":22,"value":422},"新文章返回 ",{"type":17,"tag":25,"props":424,"children":426},{"className":425},[],[427],{"type":22,"value":428},"200",{"type":22,"value":430}," 还不够，最好拉一下响应内容，确认回来的真是这篇文章的正文。要是连后面那个假地址也返回 ",{"type":17,"tag":25,"props":432,"children":434},{"className":433},[],[435],{"type":22,"value":428},{"type":22,"value":437},"，八成是服务器把所有找不到文件的请求都 rewrite 到了首页或者 ",{"type":17,"tag":25,"props":439,"children":441},{"className":440},[],[442],{"type":22,"value":443},"200.html",{"type":22,"value":445}," 兜底页。这在搜索引擎眼里叫「软 404」，会让爬虫和监控脚本误以为那个假地址真有一篇内容。让不存在的页面老老实实返回 ",{"type":17,"tag":25,"props":447,"children":449},{"className":448},[],[450],{"type":22,"value":451},"404",{"type":22,"value":453}," 状态码，线上排查会省掉很多麻烦。 ",{"type":17,"tag":267,"props":455,"children":458},{"href":456,"rel":457},"https://developers.google.com/search/docs/crawling-indexing/troubleshoot-crawling-errors",[271],[459],{"type":22,"value":460},"Google Search Central 的软 404 排查说明",{"type":17,"tag":18,"props":462,"children":463},{},[464,466,471],{"type":22,"value":465},"平时写检查脚本不用求全，先把",{"type":17,"tag":76,"props":467,"children":468},{},[469],{"type":22,"value":470},"新增的 Markdown 源文件、产物里的详情 HTML、列表页链接和 sitemap 条目",{"type":22,"value":472},"这四样绑在同一次校验里，以后文章攒得再多，每次发版心里也是踏实的。",{"type":17,"tag":474,"props":475,"children":476},"style",{},[477],{"type":22,"value":478},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":8,"searchDepth":327,"depth":327,"links":480},[481,482],{"id":44,"depth":327,"text":44},{"id":286,"depth":327,"text":289},"markdown","content:notes:static-site-release-checks.md","content","notes/static-site-release-checks.md","notes/static-site-release-checks","md",{"loc":5,"lastmod":11},[491,496,502,508,513,517,522,526,530,534,538,543,548,552,553,557],{"_path":492,"title":493,"description":494,"updated":11,"category":495},"/notes/ai-chat-stale-replies","买家连发两条消息，AI 客服怎样避免答过时？","用一段电商客服对话解释模型结果过期的原因，给出按会话校验发送、处理人工接管和核对超时回执的办法，并附可复现的验收场景。","AI 客服",{"_path":497,"title":498,"description":499,"updated":11,"category":500,"product":501},"/notes/ai-studio-changed-part-number","给画册加了个「一键白底」，AI 顺手把滤芯上的型号改了","翼程画册上线 AI 产品摄影棚时的真实插曲：手机拍的滤芯背景太乱，一键抠图换白底效果惊艳，放大一看，产品身上的印字怎么变成外星文了？","开发趣事","/e-album",{"_path":503,"title":504,"description":505,"updated":506,"category":507},"/notes/auto-parts-oe-number-alias","同一个滤芯三四个 OE 号和原厂编码，仓库怎么查才不拿错货？","针对汽配和滤芯厂同一零件对应多个 OE 号、同行对照号和车型俗称的情况，拆解一码一档建重账的坑，给出唯一主编码加别名检索和带图拣货的做法。","2026-11-20","ERP 实务",{"_path":509,"title":510,"description":511,"updated":512,"category":507},"/notes/auto-parts-returns-and-warranty","汽配退换货和三包索赔，为什么总把库存和应收账搞花？","针对汽配和滤芯批发中常见的买错退回、等价换货与质量三包索赔，拆解直接删原单和良品坏件混入库导致账实不符的原因，给出分流记账、坏件隔离和冲减应收的实操做法。","2026-11-23",{"_path":514,"title":515,"description":516,"updated":11,"category":500},"/notes/barcode-scanner-auto-enter-story","扫码枪「滴」一声之后，自己替仓管敲了个回车","记一次仓库现场调试扫码枪的乌龙：商品刚扫上去，发货单怎么自己就提交过账了？聊聊几十块钱的 USB 扫码枪在浏览器里到底干了什么。",{"_path":518,"title":519,"description":520,"updated":521,"category":507},"/notes/customer-tiered-pricing-chaos","老客户、散客、批发商价格不一样，开单时总报串价怎么办？","针对汽配、滤芯批发中老客户协议价、等级阶梯价与散客零售价并存的接单场景，拆解靠人脑记价和翻聊天记录导致报串价的原因，说明进销存记忆客户上次售价、三级取价优先级与异常低价提醒的实操做法。","2026-11-21",{"_path":523,"title":524,"description":525,"updated":11,"category":507},"/notes/erp-opening-balance-order","进销存建账顺序搞反，为什么后面的库存和欠款全对不上？","以汽配、滤芯厂首次建账为例，算清先开单后录期初、分箱和散件混录、既是客户又是供应商拆成两条时账面怎么算错，给出建账当天就能核对的检查步。",{"_path":527,"title":528,"description":529,"updated":506,"category":507},"/notes/filter-box-to-piece-inventory","滤芯厂按箱入库、按个出货，库存账怎么算才不乱？","结合滤芯与汽配仓库常见的整箱入库、拆箱散卖场景，拆解建两个商品档案导致串账的原因，说明基本单位、辅助单位换算与装箱数变动时的库存记账办法。",{"_path":531,"title":532,"description":533,"updated":11,"category":12},"/notes/markdown-article-urls","用 Markdown 发文章，怎样保留原来的网址？","官网文章用 Markdown 文件管理。标题改了为什么网址可以不变？从文件名、标题和更新日期说起，分享让文章方便维护的做法。",{"_path":535,"title":536,"description":537,"updated":11,"category":12},"/notes/nuxt-content-static-notes","用 Nuxt Content 给翼程官网做一个静态 Markdown 栏目","拆解翼程笔记的实际实现，说明 Nuxt Content 查询与渲染、动态路由预渲染、站点地图日期同步，以及排查草稿进入静态缓存的过程。",{"_path":539,"title":540,"description":541,"updated":11,"category":500,"product":542},"/notes/one-billion-order-in-demo-erp","当业务员在示例账套里开了张「一个亿」的发货单","翼程云ERP 加上「示例数据」功能后，我们在试用后台见过各种放飞自我的测试单。讲讲怎么让用户随便折腾，又能随时一键回到干净的起跑线。","/cloud-erp",{"_path":544,"title":545,"description":546,"updated":11,"category":547},"/notes/pdf-catalog-vs-e-album-search","给客户发了 30 页 PDF 报价册，为什么对方还是直接问「有没有这款」？","对比微信里发 PDF 画册与在线翻页电子画册的实际打开体验，说明图片转曲导致搜不到型号、手机端来回缩放、改价后旧文件失控三个问题及解决办法。","翼程画册",{"_path":549,"title":550,"description":551,"updated":11,"category":500,"product":542},"/notes/receipt-printer-half-meter-blank-paper","「我就改一个字」，然后小票打印机吐了半卷白纸","记一次帮客户微调 80mm 热敏小票打印模板的踩坑：只加了行收款账号，为什么每次打单后面都跟着半米空白纸？聊聊网页打印和热敏机的纸张脾气。",{"_path":5,"title":9,"description":10,"updated":11,"category":12},{"_path":554,"title":555,"description":556,"updated":11,"category":507},"/notes/stocktake-while-shipping","仓库不停工，盘点差异应该怎么算？","用一笔先移货、后补单的算例，算清不停工盘点时的账面数量、实盘数量与真实差异，并给出仓库现场可以执行的复核步骤。",{"_path":558,"title":559,"description":560,"updated":11,"category":561},"/notes/wechat-message-to-erp-order","把微信里的报价明细粘进 ERP，自动匹配商品时要防哪些错？","拆解汽配业务员用微信接单时的常见写法，说明商品名称模糊、单位未换算、价格带错三类风险，以及 AI 识别草稿在入单前必须保留的核对环节。","AI 与开单",1795421279024]