from zipfile import ZipFile from pathlib import Path base = Path("/mnt/data/Anime_OC_Neocities_Template") (base/"images").mkdir(parents=True, exist_ok=True) index = """ My OC World

✦ MY OC WORLD ✦

Welcome to my original character archive.

歡迎

把你的 OC、世界觀、小說都放在這裡。

""" characters=""" Characters

角色介紹

角色圖片

角色名稱

年齡:18

個性:請自行修改。

簡介:把你的 OC 設定貼到這裡。

""" story=""" Story

世界觀 / 故事

在這裡撰寫你的小說與世界觀。

""" gallery=""" Gallery

Gallery

""" style="""body{ margin:0; font-family:Arial,sans-serif; background:linear-gradient(180deg,#1f2348,#6a7cff); color:white; } .hero{ padding:80px 20px; text-align:center; background:rgba(255,255,255,.08); backdrop-filter:blur(8px); } nav a{ color:white; text-decoration:none; margin:0 12px; padding:10px 18px; border:1px solid rgba(255,255,255,.4); border-radius:999px; } nav a:hover{background:white;color:#333;} .card{ max-width:900px; margin:40px auto; padding:24px; background:rgba(255,255,255,.12); border-radius:20px; } .character{ display:flex; gap:24px; padding:20px; } .character img{ width:250px; height:350px; object-fit:cover; background:#ddd; border-radius:18px; } .gallery{ display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:16px; padding:20px; } .gallery img{ width:100%; aspect-ratio:3/4; background:#ddd; border-radius:18px; } footer{text-align:center;padding:30px;color:#ddd;} """ placeholder = b"" (base/"index.html").write_text(index,encoding="utf-8") (base/"characters.html").write_text(characters,encoding="utf-8") (base/"story.html").write_text(story,encoding="utf-8") (base/"gallery.html").write_text(gallery,encoding="utf-8") (base/"style.css").write_text(style,encoding="utf-8") (base/"images"/"character.png").write_bytes(placeholder) zip_path="/mnt/data/Anime_OC_Neocities_Template.zip" with ZipFile(zip_path,"w") as z: for p in base.rglob("*"): z.write(p,p.relative_to(base)) print(zip_path)