From 0d15f2365b270c0e5c101c65e77371b4c7ada00c Mon Sep 17 00:00:00 2001 From: Nelson Elhage Date: Mon, 28 Dec 2009 17:13:19 -0500 Subject: [PATCH] Initial script to generate website. --- generate-page.py | 24 ++++++++ iron-blogger.tmpl | 136 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 160 insertions(+) create mode 100644 generate-page.py create mode 100644 iron-blogger.tmpl diff --git a/generate-page.py b/generate-page.py new file mode 100644 index 0000000..41b1362 --- /dev/null +++ b/generate-page.py @@ -0,0 +1,24 @@ +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='iron-blogger.tmpl', output_encoding='utf-8') +print tmpl.render(users=all) diff --git a/iron-blogger.tmpl b/iron-blogger.tmpl new file mode 100644 index 0000000..10f3c93 --- /dev/null +++ b/iron-blogger.tmpl @@ -0,0 +1,136 @@ + + + + + Iron Blogger (for Beer) + + + + +
+

Iron Blogger

+

(With a beer money pool)

+ +

The Rules

+
    +
  1. + At least one blog post a week. Weeks will be defined as + starting and ending Monday morning at 0600. +
  2. +
  3. + You're welcome to post more than once in any given week, but + it doesn't count for the next week. +
  4. +
  5. + If you miss a post, you owe the beer pool $5. I can keep + track of this, or we can throw together a google docs + spreadsheet or something. +
  6. +
  7. + Roughly once a month, we go out for beer1. Beer is funded by the beer pool, + and we split the rest of the cost. +
  8. +
  9. + You're allowed to blog about this event as your first post. +
  10. +
  11. + Week one started today (Dec 21), so you have until the start + of the 28th to make your first post. Since you get a freebie, + this should be easy. +
  12. +
  13. + However, since you may already have plans for the week of + Christmas, you may take a free skip for the first week by + letting me know soon after you tell me you want to join. +
  14. +
  15. + Any topic or length of blog post is acceptable. If it's + obviously filler, we may laugh at you, but it still + counts. +
  16. +
  17. + These rules are open for discussion, but I reserve the right + to make an arbitrary decision and declare it official if + anyone starts wanking. +
  18. +
  19. + You're allowed to punt at any time by notifying me before + the end of the week in which you are punting. You can't + retroactively punt. +
  20. +
  21. + There is no set end date. The event may be ended by group + agreement. +
  22. +
  23. + Anyone may join up until the end of the first full week + (0600 on Monday, January 4). After that point the list is + closed, although occasional exceptions may be + possible. Email Nelson Elhage (nelhage@mit.edu) to + join. +
  24. +
+ +

Participants

+ + + + + + + +% for u in users: + + + + + +% endfor +
WhoBlog linkStart Week
${u.username} + % if u.links: + % for a in u.links: + ${a[0]} + % endfor + % else: + Undecided + % endif + ${u.start}
+ +
+

Footnotes

+
    +
  1. Some of you are underage, and some of you don't + drink beer, so we'll figure out some way to accommodate as + appropriate. I'm open to suggestions. Hard apple cider and the + like count as "beer" for the purpose of this excercise.
  2. +
+
+
+ + -- 2.30.2