diff options
author | daniel-Jones <daniel@danieljon.es> | 2017-08-30 09:52:20 +0930 |
---|---|---|
committer | daniel-Jones <daniel@danieljon.es> | 2017-08-30 09:52:20 +0930 |
commit | 108bf25d291587989e789cf0f71b33dc3c7b7737 (patch) | |
tree | 6c825ffb91ba4043fd9e0efa7081a19460145c34 /generatesite.py | |
parent | 2391386f496705debf404c2269f04f727acb974d (diff) | |
download | website-108bf25d291587989e789cf0f71b33dc3c7b7737.tar.gz website-108bf25d291587989e789cf0f71b33dc3c7b7737.zip |
various changes and additions
Diffstat (limited to 'generatesite.py')
-rw-r--r-- | generatesite.py | 10 |
1 files changed, 6 insertions, 4 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; |