pnbp

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 68c284b5f27d6b92abee160bbd88857e48f5aa90
parent 1fd1f47f97669c919a25ded1cdeb4d290990ac1c
Author: Paul Longtine <paullongtine@gmail.com>
Date:   Thu May 22 14:16:04 2014

started archive page and ajusted a few things

Diffstat:
 includes/header.html |  1 -
 mod/blog.py          |  9 +++++++++
 templates/std.html   |  5 +++++
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/includes/header.html b/includes/header.html @@ -1,4 +1,3 @@ <div> <h1>This is in fact not a blog. %page%</h1> - <a href="/%page%/all">all</a> </div> diff --git a/mod/blog.py b/mod/blog.py @@ -30,6 +30,15 @@ def getPages(template,settings,name,page): for i in data: post = generatePost(i,temp,page) pages['post'][slug(i['title'])] = template.replace("%"+name+"%",post) + + # Generates archive based off of dates. + pages['archive'] = {} + a = "" + dates = {} + for i in data: + datedata = i['date'].split["-"] + + pages['archive']['default'] = template.replace("%content%",a) return pages diff --git a/templates/std.html b/templates/std.html @@ -17,6 +17,11 @@ for i,x in pagedata.items(): i = "" i = "/"+i returns = "<a class=\"{}\" href=\"{}\">{}</a>&nbsp;".format(c, i, l) + returns +if page != "index": + page = page + "/" +else: + page = "" +returns = returns + "<a href=\"/{}all\">All posts</a>".format(page) :} <div> %content%