fix single-post.css

This commit is contained in:
2026-09-05 20:10:07 +08:00
parent d86147f406
commit d64c4cf1b4
17 changed files with 696 additions and 1 deletions
@@ -101,6 +101,27 @@ test('video cover: the player video fills and center-crops like the image cover'
);
});
test('resource singles get the cover leaf versioned, never via the aggregate @import', () => {
// 聚合文件的 @import 无版本号:浏览器会拿旧缓存(含已废弃的 .single-cover
// padding 规则)把封面高度链挤成 0,资源型文章封面直接空白。
assert.doesNotMatch(
read('assets/css/frontend/single-post.css'),
/@import[^;]*single-post\/cover\.css/,
'聚合样式不得再 @import cover leaf'
);
const enqueue = read('src/Core/ScriptsPart1b.php');
assert.match(
enqueue,
/if \(!empty\(\$singular_assets\['needs_cover'\]\)\) \{[\s\S]{0,400}?single-post\/cover\.css/,
'资源单页必须按 needs_cover 以 filemtime 版本号入队 cover leaf'
);
assert.match(
enqueue,
/'aksrt-single-post-cover'/,
'cover leaf 句柄与文章分支命名保持一致'
);
});
test('single cover css owns no fallback padding and the scale var is gone', () => {
for (const file of [
'assets/css/frontend/single-post/cover.css',