chore: baseline V8.10.0-dev.1 with v8_workflows type-mapping fix and trade-pro spec
- SiteForge Enterprise V8.10.0-dev.1 upstream source (210 tests) - Fix: v8_workflows._mapped_input now reads both 类型/分类 columns so WXR imports keep post/product types instead of collapsing to page - Docs: trade-pro theme port spec (R3) and implementation plan Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
"""Build V8.7 four full theme demonstration sites from the real builder.
|
||||
All sample names and content here are clearly fictitious demonstration data.
|
||||
"""
|
||||
import json, os, shutil
|
||||
from pathlib import Path
|
||||
BASE=Path(__file__).resolve().parent.parent
|
||||
DATA=Path(os.environ.get('SITEFORGE_DATA_DIR',str(BASE/'demo_storage')))
|
||||
os.environ['SITEFORGE_DATA_DIR']=str(DATA)
|
||||
from app import db,theme_store,builder,quality,site_design_v87
|
||||
from app.core import uid,save_entry
|
||||
from app.factory_api import bootstrap_site
|
||||
|
||||
def put(sid,typ,title,route,summary='',body='',category='',brand='',extra=None):
|
||||
fields={'category':category,'brand':brand}
|
||||
if extra:fields.update(extra)
|
||||
return save_entry(sid,{'type':typ,'title':title,'route':route,'summary':summary,'body':body,
|
||||
'meta':{'fields':fields}},source='demo')
|
||||
|
||||
def build_demo():
|
||||
db.init();theme_store.setup()
|
||||
demos={
|
||||
'automotive':('NOVA MOBILITY','探索更广阔的出行可能','汽车与出行演示主题','Cars'),
|
||||
'industrial':('ARC INDUSTRIES','面向现代工程的产品与服务','工业制造演示主题','Materials'),
|
||||
'corporate':('NORTHLINE GROUP','以专业的服务连接企业与未来','企业品牌演示主题','Services'),
|
||||
'minimal':('MONO STUDIO','少而精,让每一项作品更清晰','极简设计演示主题','Objects'),
|
||||
}
|
||||
out=Path(os.environ.get('SITEFORGE_DEMO_OUT',str(BASE/'demo_sites')));out.mkdir(parents=True,exist_ok=True)
|
||||
results={}
|
||||
for theme,(name,tagline,about,term) in demos.items():
|
||||
sid=uid()
|
||||
settings={'nav':[{'title':x,'route':r} for x,r in [('首页','/'),('产品','/products/'),('品牌','/brands/'),('新闻','/news/'),('案例','/cases/'),('关于','/about/'),('联系','/contact/')]],
|
||||
'email':'hello@example.com','footer_text':'此为 SiteForge 主题演示网站。公司、产品及内容均为虚构示例。'}
|
||||
settings['site_design']=site_design_v87.validate({
|
||||
'header':{'show_announcement':True,'announcement':'SITEFORGE V8.7 · 全站设计演示',
|
||||
'show_cta':True,'cta_text':'开始合作','cta_href':'/contact/'},
|
||||
'footer':{'title':name+' · 品牌展示','description':'SiteForge V8.7 全站页脚演示;本站所有业务信息均为虚构示例。',
|
||||
'email':'demo@example.test','show_nav':True},
|
||||
'nav':settings['nav'],
|
||||
'responsive':{'tablet_gap':68,'mobile_gap':42,'mobile_container_padding':18,
|
||||
'mobile_hide_announcement':True,'mobile_hide_footer_links':False},
|
||||
'tokens':{'font':'system','heading_scale':1.0,'radius':12,'section_spacing':72,
|
||||
'container_width':1200,'button_style':'rounded','header_style':'standard'},
|
||||
})
|
||||
db.insert('INSERT INTO sites VALUES (?,?,?,?,?,?,?,?,?,?,?)',
|
||||
(sid,name,'https://'+theme+'.example.test',tagline,theme,'#315f92','', 'new',json.dumps(settings,ensure_ascii=False),db.now(),db.now()))
|
||||
theme_store.pin(sid,theme,'1.1.0')
|
||||
put(sid,'page','首页','/',tagline)
|
||||
for i,(route,title,description) in enumerate([
|
||||
('/about/','关于我们','企业介绍、发展理念、合作能力与团队故事。'),
|
||||
('/contact/','联系我们','欢迎通过邮件与我们的演示团队取得联系。'),
|
||||
('/products/','产品中心','查看系列、类别及产品资料。'),
|
||||
('/brands/','品牌中心','探索与产品相关的品牌。'),
|
||||
('/news/','新闻资讯','了解最新消息与团队动态。'),
|
||||
('/cases/','项目案例','精选项目展示。'),
|
||||
('/services/','服务与解决方案','从咨询到交付的全链路服务。'),
|
||||
('/faq/','常见问题','更多问题可以联系我们。')]):
|
||||
put(sid,'page',title,route,description,'<p>本页为演示内容。您可以在网站工厂中直接修改和替换。</p>')
|
||||
for i,(prod,cat,brand) in enumerate([
|
||||
(f'{term} Alpha','旗舰系列','NOVA'),(f'{term} Beta','旗舰系列','NOVA'),
|
||||
(f'{term} Gamma','畅销系列','ARC'),(f'{term} Delta','畅销系列','ARC'),
|
||||
(f'{term} Epsilon','定制系列','MONO'),(f'{term} Zeta','定制系列','MONO'),
|
||||
(f'{term} Eta','专业系列','NOVA'),(f'{term} Theta','专业系列','ARC')]):
|
||||
put(sid,'product',prod,f'/products/{i+1}/',f'{prod} — 针对多样应用的演示产品。',
|
||||
'<h2>产品说明</h2><p>此处可以展示产品特点、应用场景和可用规格。</p>',cat,brand,
|
||||
{'model':'MX-'+str(200+i),'material':'Example / Demo','version':'2026','energy':'EV' if theme=='automotive' else 'Standard'})
|
||||
for name_b in ('NOVA','ARC','MONO'):
|
||||
put(sid,'brand',name_b,'/brands/'+name_b.lower()+'/',f'{name_b} 品牌产品与应用。')
|
||||
for i in range(3):
|
||||
put(sid,'post',f'企业动态 · {i+1:02d}',f'/news/{i+1}/','在这里发布新闻资讯与品牌动态。',
|
||||
'<p>这是可替换的新闻正文内容,可包含图片、表格和链接。</p>',extra={'publish_date':f'2026-10-{11+i:02}'})
|
||||
put(sid,'case',f'精选项目 · {i+1:02d}',f'/cases/{i+1}/','展示项目背景、过程与成果。',
|
||||
'<p>本页仅为项目结构示例,并非实际完成的工程项目。</p>',extra={'location':'Demo location','industry':'Demo industry'})
|
||||
put(sid,'service','供应与交付方案','/services/solution/','灵活、可配置的供应交付服务。')
|
||||
r=builder.build(sid)
|
||||
src=db.DATA/'builds'/sid/r['version']/'dist'
|
||||
dst=out/theme
|
||||
if dst.exists():shutil.rmtree(dst)
|
||||
shutil.copytree(src,dst)
|
||||
results[theme]={'page_count':r['pages'],'warnings':r['warnings'],'quality':quality.report(sid,r['version'])}
|
||||
(out/'BUILD_REPORT.json').write_text(json.dumps(results,ensure_ascii=False,indent=2),encoding='utf-8')
|
||||
print(json.dumps({k:{'pages':v['page_count'],'warnings':len(v['warnings']),'quality_errors':v['quality']['errors']} for k,v in results.items()},ensure_ascii=False,indent=2))
|
||||
if __name__=='__main__':build_demo()
|
||||
Reference in New Issue
Block a user