summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--generatesite.py6
-rw-r--r--settings.cfg5
-rw-r--r--template.txt19
3 files changed, 8 insertions, 22 deletions
diff --git a/generatesite.py b/generatesite.py
index a82156c..10afbaa 100644
--- a/generatesite.py
+++ b/generatesite.py
@@ -32,7 +32,7 @@ def generateindex():
with open(indexsrc, "r") as contentfile:
content = contentfile.read().replace('\n', '');
replace(outdir + "/index.html", "{TITLE}", cfg.get("index", "title"));
- replace(outdir + "/index.html", "{INFO}", "Index");
+ replace(outdir + "/index.html", "{INFO}", cfg.get("index", "header"));
replace(outdir + "/index.html", "{CONTENT}", content);
replace(outdir + "/index.html", "{TIME}", strftime("%Y-%m-%d %H:%M:%S", gmtime()));
@@ -56,7 +56,7 @@ def generateportfolio():
with open(portfoliosrc, "r") as contentfile:
content = contentfile.read().replace('\n', '');
replace(outdir + "/portfolio.html", "{TITLE}", cfg.get("portfolio", "title"));
- replace(outdir + "/portfolio.html", "{INFO}", "Portfolio");
+ replace(outdir + "/portfolio.html", "{INFO}", cfg.get("portfolio", "header"));
replace(outdir + "/portfolio.html", "{CONTENT}", content);
replace(outdir + "/portfolio.html", "{TIME}", strftime("%Y-%m-%d %H:%M:%S", gmtime()));
@@ -104,7 +104,7 @@ def generateblog():
with open(outdir + "/" + blogdir + "/" + str(x) + ".html", "r") as contentfile:
content = contentfile.read().replace('\n', '');
replace(outdir + "/" + blogdir + "/" + str(x) + ".html", "{TITLE}", cfg.get("blog", "title"));
- replace(outdir + "/" + blogdir + "/" + str(x) + ".html", "{INFO}", "Blog");
+ replace(outdir + "/" + blogdir + "/" + str(x) + ".html", "{INFO}", cfg.get("blog", "header"));
replace(outdir + "/" + blogdir + "/" + str(x) + ".html", "{TIME}", strftime("%Y-%m-%d %H:%M:%S", gmtime()));
# place blog posts into their pages
count = 1;
diff --git a/settings.cfg b/settings.cfg
index c094212..406352a 100644
--- a/settings.cfg
+++ b/settings.cfg
@@ -3,14 +3,17 @@ template = template.txt
dir = output
[index]
title = interesting stuff
+header = <h1>Index</h1>
src = content/index.txt
[portfolio]
title = daniel's portfolio
+header = <h1>Portfolio</h1>
src = content/portfolio.txt
[blog]
title = daniel's blog
+header = <h1>Blog</h1> Rambles about myself and programming
# blog directory
dir = blog
srcdir = content/blog
# number of posts per page
-perpage = 10
+perpage = 5
diff --git a/template.txt b/template.txt
index 23436c8..5184c14 100644
--- a/template.txt
+++ b/template.txt
@@ -12,26 +12,9 @@
<a href="https://reddit.com/u/daniel_j-">reddit</a>
<a href="http://steamcommunity.com/id/imnotstraightatall/">steam</a>
<a href="https://github.com/daniel-Jones">github</a>
-<h1>{INFO}</h1>
+{INFO}
</center>
{CONTENT}
<center><br /><font size="2"> page generated on {TIME} </font></center>
-<!-- Piwik -->
-<script type="text/javascript">
-// forgive me for I have sinned
- var _paq = _paq || [];
- /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
- _paq.push(['trackPageView']);
- _paq.push(['enableLinkTracking']);
- (function() {
- var u="//danieljon.es/piwik/";
- _paq.push(['setTrackerUrl', u+'piwik.php']);
- _paq.push(['setSiteId', '1']);
- var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
- g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
- })();
-</script>
-<!-- End Piwik Code -->
-
</body>
</html>