This commit is contained in:
hashbro
2026-08-24 06:23:07 +08:00
parent c00396dc1f
commit db574cc629
114 changed files with 108297 additions and 266 deletions
+10
View File
@@ -202,6 +202,15 @@ def normalize_landing_template(value: str | None) -> str:
return template
def ensure_route_js(weifile_dir: Path) -> Path:
src = xxbb_build.SOURCE_WEIFILE / "route.js"
if not src.is_file():
raise SystemExit(f"missing weifile router: {src}")
dest = weifile_dir / "route.js"
dest.write_text(src.read_text(encoding="utf-8"), encoding="utf-8")
return dest
def apply_landing_template(weifile_dir: Path, template: str) -> Path:
template = normalize_landing_template(template)
src = LANDING_TEMPLATE_ROOT / f"{template}.html"
@@ -273,6 +282,7 @@ def pack_channel(
encoding="utf-8",
)
apply_landing_template(weifile_dest, landing_template)
ensure_route_js(weifile_dest)
if channel_out.exists():
shutil.rmtree(channel_out)