Spaces:
Sleeping
Sleeping
| """ | |
| Template System — style/branding config lives entirely in templates/*.json. | |
| Adding a new channel means adding a new JSON file, never touching code. | |
| """ | |
| import json | |
| import os | |
| TEMPLATE_DIR = "templates" | |
| def load_template(name: str) -> dict: | |
| path = os.path.join(TEMPLATE_DIR, f"{name}.json") | |
| if not os.path.exists(path): | |
| path = os.path.join(TEMPLATE_DIR, "default.json") | |
| with open(path, "r", encoding="utf-8") as f: | |
| return json.load(f) | |