feat: port cms case layout into trade-pro
Task 10g: rewrite pages/case.html from the thin 1-line variant to the cms projects/[slug].astro design (pixel baseline dist/hesupipe/en/projects/): PageHero (breadcrumb Home > Cases > title, cover bg) + 1.2fr/0.8fr detail grid (overview block with location/industry rows + rich body via the 10d typography layer; sticky side column with main photo, 3-col gallery tiles and Results card) + Recommended Products + Other Projects (groups['case'] minus self), all empty-data sections hidden. Results points come from the open fields.results convention (semicolon/newline separated); cms dictionary fallback copy is never ported (fake data across sites). Listing case branch (10c evaluation): core form (hero + cols-3 cards + pagination) already matches cms projects list; only the hero copy voice differed, so listing.html gains a case-aware eyebrow/lead fallback (OUR PROJECTS). cms-specific tabs (no data source) and the FEATURED CASE STUDY band (HESU-static dictionary content) stay unported, documented in the template header. Adds test_trade_pro_case_layout_structure (build-flow: gallery/results structure, related-case dedup, empty-data hiding, /cases/ hero voice). Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -28,11 +28,20 @@
|
||||
契约:交互箭头一律 SVG,无裸箭头字符);页码 URL 与构建期静态分页
|
||||
路由一致(第 1 页 = 栏目根,形如 /products/page/2/ 递增)。
|
||||
6. 空列表:筛选、栅格、分页整段隐藏,替换为友好空态提示(cms 站点
|
||||
恒有内容,平台必须处理 noindex 栏目占位页的空集)。 #}
|
||||
恒有内容,平台必须处理 noindex 栏目占位页的空集)。
|
||||
7. 10g 评估 cms projects 列表([...page].astro)vs 本分支:核心形态
|
||||
(hero + cols-3 卡栅格 + 分页)一致,仅补案例口径 hero 文案
|
||||
(tp_case_like);cms 专属的 Tab 行(数据驱动分类,无数据源,同 3
|
||||
不移植)与 FEATURED CASE STUDY 双栏带(HESU 特定项目的静态词典
|
||||
内容,跨站即假数据)不移植。cms 卡片链到 /news/<slug>/ 是老站
|
||||
/progect/ 同源遗留,平台链到案例详情(正确行为)。 #}
|
||||
{% 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' %}
|
||||
{# 10g:case 类列表走 cms projects 列表口径(OUR PROJECTS),其余非文章类
|
||||
保持产品目录口径;判定与 select_listing 的路由推断同构(首项类型优先)#}
|
||||
{% set tp_case_like = (listing[0].type == 'case') if listing else (kind == 'listing' and 'case' in route) %}
|
||||
{% set tp_eyebrow = 'NEWS & INSIGHTS' if tp_post_like else ('OUR PROJECTS' if tp_case_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.') %}
|
||||
{% set tp_lead = page.summary or ('Industry updates, project stories and exhibition news from our team.' if tp_post_like else ('Project references and delivery stories from export customers worldwide.' if tp_case_like else 'Browse the full catalogue with specifications, brands and categories.')) %}
|
||||
{% set pg_root = (route.split('/page/')[0]).rstrip('/') ~ '/' %}
|
||||
{# 分页导航宏:显式传参(pg/base/icon),不依赖模板上下文闭包 #}
|
||||
{% macro tp_pages(pg, base, icon) -%}
|
||||
|
||||
Reference in New Issue
Block a user