fix: listing review round — responsive grid collapse, branch fallback, test assertions
Quality review fixes for Task 10c (2 Important + 5 Minor): - [I1] sf-tp-card-grid--listing now collapses to 2 cols at 900px and compact gap at 620px: the 3-col declaration sits after the 10a media blocks in source order, so the fold rules must live in the new 10c media blocks to win at equal specificity - [I2] tp_post_like trusts the first listing item's content type when the list is non-empty; the route-substring fallback now only applies to empty listings of kind=='listing' — /categories/post-sales-service/ style slugs can no longer flip a product category page into the news branch - [M3] empty-state negative assertions check the rendered attribute string, not the selector literal (previously always true) - [M4] catalogue section-head intro is now an item/page count instead of duplicating the hero lead - [M5] Popular reads entries link to the posts (same data as Latest, no analytics source on the platform) - [M6] both /categories/pumps/ pagination pages assert exactly one h1 - [M7] side-panel sticky top uses --sf-tp-space-24 Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,9 @@
|
||||
1. kind 分支按列表内容类型:post 类(/news/、/post/ 等文章集合)用
|
||||
新闻行形态;其余(product/vehicle/brand/case/service)复用产品卡片
|
||||
栅格——cms 只定义了这两种列表设计,品牌/案例/服务映射到产品卡形态
|
||||
(与 brand.html 相关产品、product.html 相关产品一致)。
|
||||
(与 brand.html 相关产品、product.html 相关产品一致)。非空列表只信
|
||||
首项内容类型;路由子串仅作空列表 fallback 且排除 category(否则
|
||||
/categories/post-sales-service/ 这类 slug 会被误判成新闻分支)。
|
||||
2. 产品分类侧栏仅产品类列表渲染(侧栏链接是产品分类语义,出现在
|
||||
/brands/ 等页面会误导);文章分支的侧栏是 cms 新闻三盒。空分类
|
||||
数据时侧栏整段隐藏,主列变单栏。
|
||||
@@ -27,7 +29,7 @@
|
||||
路由一致(第 1 页 = 栏目根,形如 /products/page/2/ 递增)。
|
||||
6. 空列表:筛选、栅格、分页整段隐藏,替换为友好空态提示(cms 站点
|
||||
恒有内容,平台必须处理 noindex 栏目占位页的空集)。 #}
|
||||
{% set tp_post_like = (listing and listing[0].type == 'post') or ('news' in route or 'post' in route) %}
|
||||
{% set tp_post_like = (listing[0].type == 'post') if listing else (kind == 'listing' and ('news' in route or 'post' in route)) %}
|
||||
{% set tp_eyebrow = 'NEWS & INSIGHTS' if tp_post_like else 'PRODUCT CATALOGUE' %}
|
||||
{% set tp_hero_img = safe_image(page.cover) %}
|
||||
{% set tp_lead = page.summary or ('Industry updates, project stories and exhibition news from our team.' if tp_post_like else 'Browse the full catalogue with specifications, brands and categories.') %}
|
||||
@@ -84,7 +86,7 @@
|
||||
</div>
|
||||
<aside class="sf-tp-news-aside">
|
||||
<div class="sf-tp-aside-box" data-reveal><h3>Latest posts</h3>{% for p in listing[:5] %}<p><a href="{{ safe_href(p.route) }}">{{ p.title }}</a></p>{% endfor %}</div>
|
||||
<div class="sf-tp-aside-box" data-reveal style="--reveal-i: 1"><h3>Popular reads</h3><ol>{% for p in listing[:5] %}<li>{{ p.title }}</li>{% endfor %}</ol></div>
|
||||
<div class="sf-tp-aside-box" data-reveal style="--reveal-i: 1"><h3>Popular reads</h3><ol>{% for p in listing[:5] %}<li><a href="{{ safe_href(p.route) }}">{{ p.title }}</a></li>{% endfor %}</ol></div>
|
||||
<div class="sf-tp-aside-box" data-reveal style="--reveal-i: 2"><h3>Categories</h3><p>All news <strong>{{ groups['post']|length }}</strong></p></div>
|
||||
</aside>
|
||||
</div></div></section>
|
||||
@@ -102,7 +104,9 @@
|
||||
<div class="sf-tp-catalogue-main">
|
||||
<div class="sf-tp-section-head" data-reveal>
|
||||
<div><span class="eyebrow">{{ tp_eyebrow }}</span><h2>{{ page.title }}</h2></div>
|
||||
<p class="sf-tp-intro">{{ tp_lead }}</p>
|
||||
{# 导语不与 hero 重复:主列头行改条目/页数计数(cms SectionHead 的
|
||||
intro 位在平台无独立文案来源,用真实数据代替装饰性复述) #}
|
||||
<p class="sf-tp-intro">{{ listing|length }} items{% if pagination and pagination.pages > 1 %} · {{ pagination.pages }} pages{% endif %}</p>
|
||||
</div>
|
||||
{{ filters() }}
|
||||
<div class="pro-filter-scope sf-tp-card-grid sf-tp-card-grid--listing">
|
||||
|
||||
Reference in New Issue
Block a user