diff options
-rw-r--r-- | generatesite.py | 10 | ||||
-rw-r--r-- | template.txt | 21 |
2 files changed, 26 insertions, 5 deletions
diff --git a/generatesite.py b/generatesite.py index 5770852..a82156c 100644 --- a/generatesite.py +++ b/generatesite.py @@ -41,9 +41,9 @@ def generatepagebar(currentpage, pagecount): pages = "<center>page "; for x in range(1, int(pagecount)+1): if x == int(currentpage): - pages += "<strong><i><a href=" + str(x) + ".html>" + str(x) + "</a></i></strong> "; + pages += "<strong><i><a href=" + str(x) + ">" + str(x) + "</a></i></strong> "; else: - pages += "<a href=" + str(x) + ".html>" + str(x) + "</a> "; + pages += "<a href=" + str(x) + ">" + str(x) + "</a> "; pages += "</center>"; return pages; @@ -110,14 +110,16 @@ def generateblog(): count = 1; cpage = 1; page = ""; + total_count = postcount; # count from 1 - perpage, add perpage to count, count from count - count + perpage while count < postcount + 1: for x in range(count, count + int(perpage)): if count < postcount + 1: with open(blogsrc + "/final/" + str(x) + ".txt") as contentfile: - content = contentfile.read().replace('\n', ''); - page += content + "<hr>"; + content = contentfile.read(); + page += "#" + str(total_count) + content + "<hr>"; count += 1; + total_count -= 1; if cpage <= pagecount: page += generatepagebar(str(cpage), str(int(pagecount))); page = generatepagebar(str(cpage), str(int(pagecount))) + page; diff --git a/template.txt b/template.txt index cac279f..23436c8 100644 --- a/template.txt +++ b/template.txt @@ -1,3 +1,5 @@ +<meta content="text/html;charset=utf-8" http-equiv="Content-Type"> +<meta content="utf-8" http-equiv="encoding"> <html> <head> <title>{TITLE}</title> @@ -6,7 +8,7 @@ <body bgcolor="#222" text="#eee" link="#3F51B5" vlink="#3F51B5"> <center> <h1>danieljon.es</h1> -<a href="/">index</a> <a href="/blog/1.html">blog</a> <a href="/portfolio.html">portfolio</a> </font> <br /> <br /> +<a href="/">index</a> <a href="/blog">blog</a> <a href="/portfolio.html">portfolio</a> </font> <br /> <br /> <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> @@ -14,5 +16,22 @@ </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> |