upgrade: adopt V8.31.1 (theme 1.3/1.4 redesigns, editor deep-canvas, guided launch, component library)
Overlay 190 upstream items (V8.22→8.31) preserving trade-pro theme, registry tests, and design docs. Re-applied full patch set on identical anchors (discovery/env_for/blocks.css/type-mapping/locale-override/ theme_color/frontend entries/test_theme_pro_v3 mods) plus compose pins. Verified: theme suites 35/35; dual-baseline full run 415 passed vs pristine 386+29 ours, FAILED-set diff EMPTY (same 10 Windows env fails). Live: container 8.31.1-dev.1 healthy, hesupipe 192 entries intact, trade-pro build 203 pages 0 errors. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -204,6 +204,7 @@ def build(site_id,mirror=False):
|
||||
if visuals.is_dir():
|
||||
shutil.copytree(visuals,dist/'assets'/'visual',dirs_exist_ok=True)
|
||||
shutil.copy2(ROOT/'app'/'static'/'pro.js',dist/'assets'/'pro.js')
|
||||
shutil.copy2(ROOT/'app'/'static'/'auto31.js',dist/'assets'/'auto31.js')
|
||||
if (theme_dir/'pro.css').exists():
|
||||
shutil.copy2(theme_dir/'pro.css',dist/'assets'/'pro.css')
|
||||
else:
|
||||
@@ -226,6 +227,7 @@ def build(site_id,mirror=False):
|
||||
f'.btn,.primary,.request,.button,.nav-btn{{background-color:{accent};border-radius:{button}}}'
|
||||
f'body .sf-canvas h1{{font-size:clamp(2.5rem,5vw,calc(4.8rem * var(--sf-heading-scale)))}}')
|
||||
(dist/'assets'/'custom.css').write_text(theme_css+responsive.site_css(records)+site_design_v87.responsive_css(site_design_v87.published(settings)),encoding='utf-8')
|
||||
|
||||
# For installed theme packages, Jinja loads only the trusted included template.
|
||||
professional_template=(theme_dir/'pro.html').exists()
|
||||
if professional_template and site['theme'] not in theme_pro.THEMES:
|
||||
@@ -393,6 +395,26 @@ def build(site_id,mirror=False):
|
||||
(dist/'404.html').write_text(missing_html,encoding='utf-8')
|
||||
# A complete static search page is packaged for every theme, not a live API.
|
||||
static_site.write_assets(dist,local_records)
|
||||
# V8.31.1: only the opt-in automotive theme uses the single-request asset
|
||||
# bundles. Older pinned theme versions retain their exact original HTML and
|
||||
# resource order, so existing sites are not silently changed.
|
||||
if site['theme']=='automotive' and (theme_dir/'manifest.json').is_file() and json.loads((theme_dir/'manifest.json').read_text(encoding='utf-8')).get('version')=='1.4.1':
|
||||
# Preserve CSS cascade by concatenating precisely in template order.
|
||||
css_names=('theme.css','blocks.css','factory.css','pro-base.css','pro.css','commercial.css','custom.css')
|
||||
for resource in css_names:
|
||||
if not (dist/'assets'/resource).is_file():
|
||||
raise ValueError('汽车资源缺失: '+resource)
|
||||
(dist/'assets'/'auto-compiled.css').write_text(
|
||||
'\n'.join((dist/'assets'/name).read_text(encoding='utf-8') for name in css_names),encoding='utf-8')
|
||||
js_names=('site-runtime.js','pro.js','auto31.js')
|
||||
for resource in js_names:
|
||||
if not (dist/'assets'/resource).is_file():
|
||||
raise ValueError('汽车脚本资源缺失: '+resource)
|
||||
(dist/'assets'/'auto-compiled.js').write_text(
|
||||
'\n;\n'.join((dist/'assets'/name).read_text(encoding='utf-8') for name in js_names),encoding='utf-8')
|
||||
shutil.copy2(theme_dir/'auto-icons.svg',dist/'assets'/'auto-icons.svg')
|
||||
|
||||
|
||||
if '/search/' not in route_set:
|
||||
search_file=dist/'search'/'index.html'
|
||||
search_file.parent.mkdir(parents=True,exist_ok=True)
|
||||
|
||||
Reference in New Issue
Block a user