From 669e806c271fc93c7d464fd06a6f6e8ec1a76fa1 Mon Sep 17 00:00:00 2001 From: daniel-Jones Date: Fri, 23 Feb 2018 16:42:11 +1030 Subject: added interesting page to list things i find interesting --- generatesite.py | 18 ++++++++++++++++++ settings.cfg | 7 ++++++- template.txt | 2 +- templates/template_dark.txt | 2 +- templates/template_kawaii.txt | 2 +- templates/template_light.txt | 3 +-- templates/template_nocss.txt | 2 +- 7 files changed, 29 insertions(+), 7 deletions(-) diff --git a/generatesite.py b/generatesite.py index 919570e..0ee35f4 100644 --- a/generatesite.py +++ b/generatesite.py @@ -201,6 +201,23 @@ def generatewaifus(special): replace(outdir + "/" + waifusdir + "/index.html", "{CONTENT}", content); replace(outdir + "/" + waifusdir + "/index.html", "{TIME}", strftime("%Y-%m-%d %H:%M:%S", gmtime())); +def generateinteresting(special): + if special: + outdir = specialoutput; + else: + outdir = cfg.get("output", "dir"); + portfoliosrc = cfg.get("interesting", "src"); + print("generating {}/interesting.html from {}".format(outdir, portfoliosrc)); + copyfile(template, outdir + "/interesting.html"); + with open(portfoliosrc, "r") as contentfile: + content = contentfile.read(); + replace(outdir + "/interesting.html", "{TITLE}", cfg.get("interesting", "title")); + replace(outdir + "/interesting.html", "{INFO}", cfg.get("interesting", "header")); + replace(outdir + "/interesting.html", "{CONTENT}", content); + replace(outdir + "/interesting.html", "{TIME}", strftime("%Y-%m-%d %H:%M:%S", gmtime())); + + + if __name__ == "__main__": cfg = configparser.ConfigParser(); cfg.read("settings.cfg"); @@ -218,3 +235,4 @@ if __name__ == "__main__": generateportfolio(special); # portfolio generateopinions(special); # opinions/anime generatewaifus(special); # my waifus + generateinteresting(special); # interesting stuff diff --git a/settings.cfg b/settings.cfg index 128e8cb..35733c0 100644 --- a/settings.cfg +++ b/settings.cfg @@ -37,7 +37,12 @@ src = content/opinions/everything.txt [waifus] title = waifus -header =

My waifus, not yours

All other waifus are literal trash +header =

My waifus, not yours

All other waifus are literal trash. dir = waifus src = content/waifus/index.txt +[interesting] +title = interesting +header =

interesting

Things I have found online that are interesting or entertaining to me. +src = content/interesting.txt + diff --git a/template.txt b/template.txt index 8532db4..0095a94 100644 --- a/template.txt +++ b/template.txt @@ -31,7 +31,7 @@ div.cover{display:inline-block; vertical-align: top; padding-top: 28px; padding-

danieljon.es

normal light dark no css
-index blog projects opinions git +index blog projects opinions interesting git {INFO}
diff --git a/templates/template_dark.txt b/templates/template_dark.txt index ad3d37c..a8d44bf 100644 --- a/templates/template_dark.txt +++ b/templates/template_dark.txt @@ -30,7 +30,7 @@ div.cover{display:inline-block; vertical-align: top; padding-top: 28px; padding-
diff --git a/templates/template_kawaii.txt b/templates/template_kawaii.txt index 0a31f5e..8c063a3 100644 --- a/templates/template_kawaii.txt +++ b/templates/template_kawaii.txt @@ -26,7 +26,7 @@ div.cover{display:inline-block; vertical-align: top; padding-top: 28px; padding-
diff --git a/templates/template_light.txt b/templates/template_light.txt index 96ba4a2..8b7808b 100644 --- a/templates/template_light.txt +++ b/templates/template_light.txt @@ -26,8 +26,7 @@ div.cover{display:inline-block; vertical-align: top; padding-top: 28px; padding-
diff --git a/templates/template_nocss.txt b/templates/template_nocss.txt index 1454ce7..cd0be76 100644 --- a/templates/template_nocss.txt +++ b/templates/template_nocss.txt @@ -13,7 +13,7 @@

danieljon.es

normal light dark no css
-index blog projects opinions git +index blog projects opinions interesting git {INFO} {CONTENT}

page generated {TIME} using sitegenerator -- cgit v1.2.3