summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaniel-Jones <daniel@danieljon.es>2017-11-18 14:53:57 +1100
committerdaniel-Jones <daniel@danieljon.es>2017-11-18 14:53:57 +1100
commite4e026d06d084b21e59a835a6605903c439cd5a9 (patch)
treee436c08ee8c89ba537223210ea3671df5a3ee573
parent471e36c4cd19834ea024eca29260c79647e6fe9b (diff)
downloadwebsite-e4e026d06d084b21e59a835a6605903c439cd5a9.tar.gz
website-e4e026d06d084b21e59a835a6605903c439cd5a9.zip
blog
added prev, next, start and end buttons to the blog navigation bar.
-rw-r--r--generatesite.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/generatesite.py b/generatesite.py
index a7b0321..0f5d399 100644
--- a/generatesite.py
+++ b/generatesite.py
@@ -38,13 +38,13 @@ def generateindex():
def generatepagebar(currentpage, pagecount):
print("generating page bar for {} total {}".format(currentpage, pagecount));
- pages = "<div class='middle'>page ";
+ pages = "<div class='middle'>page <a href='1'><-</a> <a href='" + str(1 if currentpage == 1 else int(currentpage)-1) + "'>prev</a> ";
for x in range(1, int(pagecount)+1):
if x == int(currentpage):
pages += "<strong><i><a href=" + str(x) + ">" + str(x) + "</a></i></strong> ";
else:
pages += "<a href=" + str(x) + ">" + str(x) + "</a> ";
- pages += "</div>";
+ pages += "<a href='" + str(1 if currentpage == pagecount else int(currentpage)+1) + "'>next</a> <a href='" + str(x) + "'>-></a></div>";
return pages;
def generateportfolio():
@@ -60,8 +60,6 @@ def generateportfolio():
replace(outdir + "/portfolio.html", "{CONTENT}", content);
replace(outdir + "/portfolio.html", "{TIME}", strftime("%Y-%m-%d %H:%M:%S", gmtime()));
-
-
def deletefiles(ddir):
# delete all blog files
for the_file in os.listdir(ddir):
@@ -69,7 +67,6 @@ def deletefiles(ddir):
if os.path.isfile(file_path):
os.unlink(file_path);
-
def generateblog():
template = cfg.get("output", "template");
outdir = cfg.get("output", "dir");