summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaniel-Jones <daniel@danieljon.es>2017-11-11 10:23:39 +1100
committerdaniel-Jones <daniel@danieljon.es>2017-11-11 10:23:39 +1100
commitb59e1f434a6a0dbad6c66fef4eed2f47687500e3 (patch)
tree3a0ad782d75fb74216e927cd6dacfa89891e00f6
parent05307cc7d96d607453f1ed8d2f87e2c8daf295a0 (diff)
downloadwebsite-b59e1f434a6a0dbad6c66fef4eed2f47687500e3.tar.gz
website-b59e1f434a6a0dbad6c66fef4eed2f47687500e3.zip
added waifu generation. good god i wish this was real.
-rw-r--r--generatesite.py22
-rw-r--r--settings.cfg5
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