From: Nelson Elhage Date: Tue, 29 Dec 2009 19:06:12 +0000 (-0500) Subject: Use show-week to generate the overall template, too. X-Git-Url: https://projects.mako.cc/source/iron-blogger/commitdiff_plain/bf1fb66fb40e3ad7a6bb8a3c361aa3318cfc0331?ds=sidebyside Use show-week to generate the overall template, too. --- diff --git a/generate-page.py b/generate-page.py deleted file mode 100755 index 9495e6b..0000000 --- a/generate-page.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/python -import yaml -from mako.template import Template - -with open('bloggers.yml') as f: - users = yaml.safe_load(f.read()) - -class User(object): - pass - -all = [] -for (un, rec) in users.items(): - u = User() - u.username = un - u.links = rec['links'] - u.start = rec['start'] - all.append(u) - -def user_key(u): - return (u.start, u.username) - -all.sort(key=user_key) - -tmpl = Template(filename='templates/iron-blogger.tmpl', output_encoding='utf-8') -print tmpl.render(users=all) diff --git a/templates/iron-blogger.tmpl b/templates/iron-blogger.tmpl index 10f3c93..e0620af 100644 --- a/templates/iron-blogger.tmpl +++ b/templates/iron-blogger.tmpl @@ -105,7 +105,7 @@ Blog link Start Week -% for u in users: +% for u in userlist: ${u.username}