From a899e9f5a9b7690cc6961c12d0ba70dfcc494c1b Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Wed, 13 May 2015 11:43:17 +0200 Subject: [PATCH] add anchors to posts --- generator.py | 3 +++ templates/thread.html.j2 | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/generator.py b/generator.py index 87dd68d..e113377 100755 --- a/generator.py +++ b/generator.py @@ -12,6 +12,9 @@ import argparse, json, os, re, shutil from datetime import datetime from jinja2 import Environment, FileSystemLoader +import sys +reload(sys); sys.setdefaultencoding('utf-8') + def fromunixtime(value): return datetime.fromtimestamp(value).strftime('%Y-%m-%d %H:%M:%S') diff --git a/templates/thread.html.j2 b/templates/thread.html.j2 index 096bf75..71fc3d8 100644 --- a/templates/thread.html.j2 +++ b/templates/thread.html.j2 @@ -9,7 +9,9 @@

{{ thread.title }}

{% for post in thread.posts %} -

{{ post.user.name }} - {{ post.timestamp | fromunixtime }}

+ {{ loop.index }} - + {{ post.user.name }} + ({{ post.timestamp | fromunixtime }})

{{ post.message | tohtml }}

{% for attachment in post.attachments %} --