From 108bf25d291587989e789cf0f71b33dc3c7b7737 Mon Sep 17 00:00:00 2001 From: daniel-Jones Date: Wed, 30 Aug 2017 09:52:20 +0930 Subject: various changes and additions --- generatesite.py | 10 ++++++---- 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 = "
page "; for x in range(1, int(pagecount)+1): if x == int(currentpage): - pages += "" + str(x) + " "; + pages += "" + str(x) + " "; else: - pages += "" + str(x) + " "; + pages += "" + str(x) + " "; pages += "
"; 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 + "
"; + content = contentfile.read(); + page += "#" + str(total_count) + content + "
"; 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 @@ + + {TITLE} @@ -6,7 +8,7 @@

danieljon.es

-index blog portfolio

+index blog portfolio

reddit steam github @@ -14,5 +16,22 @@
{CONTENT}

page generated on {TIME}
+ + + + -- cgit v1.2.3