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 %} --