Add Site Studio themes and Theme Manager
Support categorized fragments, theme presets, block widths, and server-backed theme editing with onboarding and preview. Include Site Studio, design sources, specification and verification reports; remove the legacy studio-site example.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Offline smoke test of Site Studio's width-mode example."""
|
||||
from pathlib import Path
|
||||
import yaml
|
||||
p = Path(__file__).resolve().parents[1]
|
||||
theme = yaml.safe_load((p/'theme.yaml').read_text())
|
||||
c = theme['overrides']['ui']['container']
|
||||
assert c['mode'] in {'boxed','fluid','full'}
|
||||
assert 720 <= c['max_width'] <= 1920
|
||||
assert all(isinstance(x,int) and 0<=x<=96 for x in c['gutter'].values())
|
||||
raw=(p/'pages/index.md').read_text()
|
||||
yaml_text=raw[4:].split('\n---\n')[0]
|
||||
blocks=yaml.safe_load(yaml_text)['regions']['main']
|
||||
assert blocks[0]['layout']=={'section_width':'full','content_width':'boxed'}
|
||||
assert blocks[1]['layout']=={'section_width':'fluid','content_width':'fluid'}
|
||||
assert blocks[-1]['layout']=={'section_width':'full','content_width':'boxed'}
|
||||
index=(p/'preview-dist/index.html').read_text()
|
||||
for mode in ['data-section-width="full" data-content-width="boxed"','data-section-width="fluid" data-content-width="fluid"']:
|
||||
assert mode in index
|
||||
print('Container settings and preview: OK')
|
||||
Reference in New Issue
Block a user