File size: 881 Bytes
0d64a56 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | """Mirror the WING project page into this static Space.
The page code is copied verbatim apart from asset URLs. Media stays on the
existing project website, so the Space does not duplicate large video files.
"""
from pathlib import Path
SPACE_DIR = Path(__file__).resolve().parent
WEBSITE_DIR = SPACE_DIR.parent
WEBSITE_URL = "https://mikuz12.github.io/wing/"
SOURCE_FILES = ("index.html", "styles.css", "script.js", "experiments.js")
ASSET_PREFIXES = ("assets/", "gen/", "main.pdf", "teaser.pdf", "wing_logo.png")
def main() -> None:
for name in SOURCE_FILES:
content = (WEBSITE_DIR / name).read_text(encoding="utf-8")
for prefix in ASSET_PREFIXES:
content = content.replace(prefix, WEBSITE_URL + prefix)
(SPACE_DIR / name).write_text(content, encoding="utf-8")
print(f"Synced {name}")
if __name__ == "__main__":
main()
|