summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaniel-Jones <daniel@danieljon.es>2018-01-15 23:36:31 +1030
committerdaniel-Jones <daniel@danieljon.es>2018-01-15 23:36:31 +1030
commitee0b9b4284a19c96a3d72d81e770594ce5162f4f (patch)
tree07e51f2bb4381983392cfc131acb8299a87a2449
parent2b6d6a34b63899912ff5f3616f1796c28cc1864d (diff)
downloadwebsite-ee0b9b4284a19c96a3d72d81e770594ce5162f4f.tar.gz
website-ee0b9b4284a19c96a3d72d81e770594ce5162f4f.zip
added new section named opinions. removed the viewings section, that is now integrated into opinions.
-rw-r--r--generatesite.py39
-rw-r--r--settings.cfg19
-rwxr-xr-xsetup.sh10
-rw-r--r--template.txt2
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 = <h1>Opinions</h1>Thoughts and opinions on various subjects and media that I have consumed.<br><br>
+dir = opinions
+src = content/opinions/index.txt
[anime]
-title = viewings
-header = <h1>Opinions</h1>Various thoughts and opinions on media I have consumed. Spoilers ahead.<br><br>
-dir = viewings
-src = content/viewings/index.txt
+title = anime
+header = <h1>Anime</h1>Thoughts on some of my favourite anime series. Spoilers ahead.<br><br>
+src = content/opinions/anime.txt
+[everything]
+title = everything else
+header = <h1>Everything else</h1>Thoughts on everything else that I need to get off my chest.<br><br>
+src = content/opinions/everything.txt
+
[waifus]
title = waifus
header = <h1>My waifus, not yours</h1>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 "<h1>First blog post title</h1> <h3>11/22/3333</h3> <p> blog content here!"
echo "<h1>Second blog post title</h1> <h3>11/23/3333</h3> <p> blog content here!" > content/blog/2.txt
#make content/waifu/index.txt
echo "<div class='cover'><img src='https://danieljon.es/waifus/media/nico.png' alt='Nico Yazawa'></div><div class='viewing'><h3>Nico Yazawa</h3>Nico's better-than-you nature and <a href='https://danieljon.es/nico'>awesome idol skill</a> makes her the perfect number one waifu. Seriously, she has it all, great looks, <a href='https://www.youtube.com/watch?v=xX050NcDNAU'>flat-as-a-pancake</a> physique and <a href='https://www.youtube.com/watch?v=T4iC52d-fVY'>the bestest catchphrase</a> ever." > content/waifus/index.txt
-#make content/viewings/index.txt
-echo "<div class='middiv'><div class='cover'><img src='https://danieljon.es/viewings/media/kon1_cover.jpg' alt='k-on! cover'></div><div class='viewing'><h3>K-On!</h3>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. <br><br>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. <br><br>The <a href='https://www.youtube.com/watch?v=TIpA_B5khZc'>OP of K-On!</a> 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.</div></div>" > content/viewings/index.txt
+#make content/opinions/anime.txt
+echo "<div class='middiv'><div class='cover'><img src='https://danieljon.es/viewings/media/kon1_cover.jpg' alt='k-on! cover'></div><div class='viewing'><h3>K-On!</h3>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. <br><br>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. <br><br>The <a href='https://www.youtube.com/watch?v=TIpA_B5khZc'>OP of K-On!</a> 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.</div></div>" > content/opinions/anime.txt
+#make content/opinions/index.txt
+echo "Opinions on things. <br><br> <a href='anime.html'>anime</a> & <a href='everything.html'>everything else</a>." > 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-
<body>
<div class="middle">
<h1>danieljon.es</h1>free of Javascript, minimal CSS.<br><br>
-<a href="/">index</a> <a href="/blog">blog</a> <a href="/portfolio.html">projects</a> <a href="/viewings">opinions</a> <a href="https://git.danieljon.es">git</a>
+<a href="/">index</a> <a href="/blog">blog</a> <a href="/portfolio.html">projects</a> <a href="/opinions">opinions</a> <a href="https://git.danieljon.es">git</a>
{INFO}
</div>
<div class="content">