neocities-site/generator.py
2024-06-22 12:43:14 -06:00

20 lines
652 B
Python

import os
static = os.listdir("pages/static/")
posts = os.listdir("pages/posts")
templates = ["header","navbar","body","footer"]
for staticPage in static:
with open("site/" + staticPage, 'w+') as output:
for page in templates:
with open ("templates/" + page + ".htm") as template:
for line in template:
if "%Content%" in line:
line = ""
with open("pages/static/" + staticPage) as content:
for line1 in content:
line += "\t\t\t" + line1
output.write(line)