From ee0b9b4284a19c96a3d72d81e770594ce5162f4f Mon Sep 17 00:00:00 2001 From: daniel-Jones Date: Mon, 15 Jan 2018 23:36:31 +1030 Subject: added new section named opinions. removed the viewings section, that is now integrated into opinions. --- generatesite.py | 39 ++++++++++++++++++++++++++++++--------- settings.cfg | 19 +++++++++++++++---- setup.sh | 10 +++++++--- template.txt | 2 +- 4 files changed, 53 insertions(+), 17 deletions(-) diff --git a/generatesite.py b/generatesite.py index ac72a0a..071f478 100644 --- a/generatesite.py +++ b/generatesite.py @@ -139,19 +139,40 @@ def generateblog(): -def generateanime(): +def generateopinions(): template = cfg.get("output", "template"); outdir = cfg.get("output", "dir"); + opinionssrc = cfg.get("opinions", "src"); + opinionsdir = cfg.get("opinions", "dir"); + print("generating {}/{}/index.html from {}".format(outdir, opinionsdir, opinionssrc)); + copyfile(template, outdir + "/" + opinionsdir + "/index.html"); + with open(opinionssrc, "r") as contentfile: + content = contentfile.read(); + replace(outdir + "/" + opinionsdir + "/index.html", "{TITLE}", cfg.get("opinions", "title")); + replace(outdir + "/" + opinionsdir + "/index.html", "{INFO}", cfg.get("opinions", "header")); + replace(outdir + "/" + opinionsdir + "/index.html", "{CONTENT}", content); + replace(outdir + "/" + opinionsdir + "/index.html", "{TIME}", strftime("%Y-%m-%d %H:%M:%S", gmtime())); + # anime animesrc = cfg.get("anime", "src"); - animedir = cfg.get("anime", "dir"); - print("generating {}/{}/index.html from {}".format(outdir, animedir, animesrc)); - copyfile(template, outdir + "/" + animedir + "/index.html"); + print("generating {}/{}/index.html from {}".format(outdir, opinionsdir, animesrc)); + copyfile(template, outdir + "/" + opinionsdir + "/anime.html"); with open(animesrc, "r") as contentfile: content = contentfile.read(); - replace(outdir + "/" + animedir + "/index.html", "{TITLE}", cfg.get("anime", "title")); - replace(outdir + "/" + animedir + "/index.html", "{INFO}", cfg.get("anime", "header")); - replace(outdir + "/" + animedir + "/index.html", "{CONTENT}", content); - replace(outdir + "/" + animedir + "/index.html", "{TIME}", strftime("%Y-%m-%d %H:%M:%S", gmtime())); + replace(outdir + "/" + opinionsdir + "/anime.html", "{TITLE}", cfg.get("anime", "title")); + replace(outdir + "/" + opinionsdir + "/anime.html", "{INFO}", cfg.get("anime", "header")); + replace(outdir + "/" + opinionsdir + "/anime.html", "{CONTENT}", content); + replace(outdir + "/" + opinionsdir + "/anime.html", "{TIME}", strftime("%Y-%m-%d %H:%M:%S", gmtime())); + #everything else + everythingsrc = cfg.get("everything", "src"); + print("generating {}/{}/index.html from {}".format(outdir, opinionsdir, everythingsrc)); + copyfile(template, outdir + "/" + opinionsdir + "/everything.html"); + with open(everythingsrc, "r") as contentfile: + content = contentfile.read(); + replace(outdir + "/" + opinionsdir + "/everything.html", "{TITLE}", cfg.get("everything", "title")); + replace(outdir + "/" + opinionsdir + "/everything.html", "{INFO}", cfg.get("everything", "header")); + replace(outdir + "/" + opinionsdir + "/everything.html", "{CONTENT}", content); + replace(outdir + "/" + opinionsdir + "/everything.html", "{TIME}", strftime("%Y-%m-%d %H:%M:%S", gmtime())); + def generatewaifus(): template = cfg.get("output", "template"); @@ -174,5 +195,5 @@ if __name__ == "__main__": generateindex(); # index generateblog(); # blog with individual pages generateportfolio(); # portfolio - generateanime(); # anime recommendations + generateopinions(); # opinions/anime generatewaifus(); # my waifus diff --git a/settings.cfg b/settings.cfg index f0b4fb0..85b87b1 100644 --- a/settings.cfg +++ b/settings.cfg @@ -19,11 +19,22 @@ direct = direct srcdir = content/blog # number of posts per page perpage = 10 + +# opinions section, website generator rewrite will make this prettier +[opinions] +title = opinions +header =

Opinions

Thoughts and opinions on various subjects and media that I have consumed.

+dir = opinions +src = content/opinions/index.txt [anime] -title = viewings -header =

Opinions

Various thoughts and opinions on media I have consumed. Spoilers ahead.

-dir = viewings -src = content/viewings/index.txt +title = anime +header =

Anime

Thoughts on some of my favourite anime series. Spoilers ahead.

+src = content/opinions/anime.txt +[everything] +title = everything else +header =

Everything else

Thoughts on everything else that I need to get off my chest.

+src = content/opinions/everything.txt + [waifus] title = waifus header =

My waifus, not yours

All other waifus are literal trash diff --git a/setup.sh b/setup.sh index 4c552be..462930b 100755 --- a/setup.sh +++ b/setup.sh @@ -7,7 +7,7 @@ mkdir output/waifus/ mkdir content/ mkdir content/blog/ mkdir content/blog/final/ -mkdir content/viewings/ +mkdir content/opinions/ mkdir content/waifus/ # files @@ -21,5 +21,9 @@ echo "

First blog post title

11/22/3333

blog content here!" echo "

Second blog post title

11/23/3333

blog content here!" > content/blog/2.txt #make content/waifu/index.txt echo "

Nico Yazawa

Nico Yazawa

Nico's better-than-you nature and awesome idol skill makes her the perfect number one waifu. Seriously, she has it all, great looks, flat-as-a-pancake physique and the bestest catchphrase ever." > content/waifus/index.txt -#make content/viewings/index.txt -echo "
k-on! cover

K-On!

K-On I believe was the first anime I had ever watched while not a little kid (those were cartoons, but some technically anime) and definitely was a big part in introducing me to the 'cute girls doing cute things' genre, which to this day is my most viewed and enjoyed.

The story revolves around four (later five) girls entering highschool and selecting to join the 'light music' club, that members of that club had all graduated the prior year, so they were entirely on their own. They were to eventually form a band, write and create songs that they performed at various venues. However, really it's all about the girls eating snacks and having whacky fun.

The OP of K-On! is one I think I will never skip, it's so energetic and fun, definitely worth a watch if you haven't seen it. The ED wasn't anything spectacular music wise, but the art was great.
" > content/viewings/index.txt +#make content/opinions/anime.txt +echo "
k-on! cover

K-On!

K-On I believe was the first anime I had ever watched while not a little kid (those were cartoons, but some technically anime) and definitely was a big part in introducing me to the 'cute girls doing cute things' genre, which to this day is my most viewed and enjoyed.

The story revolves around four (later five) girls entering highschool and selecting to join the 'light music' club, that members of that club had all graduated the prior year, so they were entirely on their own. They were to eventually form a band, write and create songs that they performed at various venues. However, really it's all about the girls eating snacks and having whacky fun.

The OP of K-On! is one I think I will never skip, it's so energetic and fun, definitely worth a watch if you haven't seen it. The ED wasn't anything spectacular music wise, but the art was great.
" > content/opinions/anime.txt +#make content/opinions/index.txt +echo "Opinions on things.

anime & everything else." > content/opinions/index.txt +#make content/opinions/everything.txt +echo "Put your own stuff here." > content/opinions/everything.txt diff --git a/template.txt b/template.txt index 39da210..ca55456 100644 --- a/template.txt +++ b/template.txt @@ -25,7 +25,7 @@ div.cover{display:inline-block; vertical-align: top; padding-top: 28px; padding-

danieljon.es

free of Javascript, minimal CSS.

-index blog projects opinions git +index blog projects opinions git {INFO}
-- cgit v1.2.3