演示包含虚构企业与产品数据。此单文件用于查看实际生成页面的视觉布局;完整网站的导航、搜索和筛选请在 Docker 或静态 Web 服务器部署演示站后体验。
"""Self-contained HTML preview from the actual four built static sites.
It inlines production CSS; navigation/build/SEO remains in the accompanying ZIP.
"""
import json,re,base64
from pathlib import Path
root=Path(__import__('sys').argv[1]).resolve() if len(__import__('sys').argv)>1 else Path(__file__).resolve().parent.parent/'demo_sites'
out=Path(__import__('sys').argv[2]).resolve() if len(__import__('sys').argv)>2 else Path(__file__).resolve().parent.parent/'theme-preview.html'
styles=['theme.css','blocks.css','factory.css','pro-base.css','pro.css','commercial.css','custom.css']
data={}
for theme in ('automotive','industrial','corporate','minimal'):
base=root/theme
pages={'home':'index.html','products':'products/index.html','detail':'products/1/index.html','news':'news/index.html','case':'cases/1/index.html','about':'about/index.html','contact':'contact/index.html'}
data[theme]={}
for name,file in pages.items():
src=(base/file).read_text(encoding='utf-8')
for css in styles:
text=(base/'assets'/css).read_text(encoding='utf-8')
visual=base/'assets'/'visual'/'hero.svg'
if visual.is_file():
text=text.replace('./visual/hero.svg','data:image/svg+xml;base64,'+base64.b64encode(visual.read_bytes()).decode())
src=src.replace(f'','')
src=src.replace('
演示包含虚构企业与产品数据。此单文件用于查看实际生成页面的视觉布局;完整网站的导航、搜索和筛选请在 Docker 或静态 Web 服务器部署演示站后体验。