diff options
-rw-r--r-- | generatesite.py | 22 | ||||
-rw-r--r-- | settings.cfg | 5 |
2 files changed, 23 insertions, 4 deletions
diff --git a/generatesite.py b/generatesite.py index a0a5834..a7b0321 100644 --- a/generatesite.py +++ b/generatesite.py @@ -146,12 +146,26 @@ def generateanime(): replace(outdir + "/" + animedir + "/index.html", "{CONTENT}", content); replace(outdir + "/" + animedir + "/index.html", "{TIME}", strftime("%Y-%m-%d %H:%M:%S", gmtime())); +def generatewaifus(): + template = cfg.get("output", "template"); + outdir = cfg.get("output", "dir"); + waifussrc = cfg.get("waifus", "src"); + waifusdir = cfg.get("waifus", "dir"); + print("generating {}/{}/index.html from {}".format(outdir, waifusdir, waifussrc)); + copyfile(template, outdir + "/" + waifusdir + "/index.html"); + with open(waifussrc, "r") as contentfile: + content = contentfile.read(); + replace(outdir + "/" + waifusdir + "/index.html", "{TITLE}", cfg.get("waifus", "title")); + replace(outdir + "/" + waifusdir + "/index.html", "{INFO}", cfg.get("waifus", "header")); + replace(outdir + "/" + waifusdir + "/index.html", "{CONTENT}", content); + replace(outdir + "/" + waifusdir + "/index.html", "{TIME}", strftime("%Y-%m-%d %H:%M:%S", gmtime())); if __name__ == "__main__": cfg = configparser.ConfigParser(); cfg.read("settings.cfg"); os.makedirs(cfg.get("output", "dir"), exist_ok=True); - generateindex(); - generateblog(); - generateportfolio(); - generateanime(); + generateindex(); # index + generateblog(); # blog with individual pages + generateportfolio(); # portfolio + generateanime(); # anime recommendations + generatewaifus(); # my waifus diff --git a/settings.cfg b/settings.cfg index b433d7d..a6a1297 100644 --- a/settings.cfg +++ b/settings.cfg @@ -22,3 +22,8 @@ title = anime header = <h1>Anime I recommend</h1> dir = viewings src = content/viewings/index.txt +[waifus] +title = waifus +header = <h1>My waifus, not yours</h1>All other waifus are literal trash +dir = waifus +src = content/waifus/index.txt |