diff --git a/generator.py b/generator.py index 2059d95..f33576b 100755 --- a/generator.py +++ b/generator.py @@ -30,7 +30,7 @@ def tohtml(value): value = re.sub(r'\[url=\/user\/(.*?)\](.*?)\[\/url\]', user_replacer, value) value = re.sub(r'\[url=(.*?)\](.*?)\[/url\]', r'\2', value) value = re.sub(r'\[video\](.*?)\[/video\]', r'\1', value) - value = re.sub(r'\[color=(.*?)\](.*?)\[/color\]', r'\2', value) + value = re.sub(r'\[colour=(.*?)\](.*?)\[/colour\]', r'\2', value) value = re.sub(r'\[b\](.*?)\[/b\]', r'\1', value) value = re.sub(r'\[i\](.*?)\[/i\]', r'\1', value) value = re.sub(r'\[u\](.*?)\[/u\]', r'\1', value) @@ -77,7 +77,7 @@ def render_boards(boards, template_board, template_thread, outpath, title): write_render(rendered_board, os.path.join('board', url_replacer(board['title']) + '.html'), outpath) for thread in board['threads']: - rendered_thread = template_thread.render(thread=thread, title=title + ' - ' + thread['title']) + rendered_thread = template_thread.render(board=board, thread=thread, title=title + ' - ' + thread['title']) write_render(rendered_thread, os.path.join('board', 'thread', url_replacer(thread['title']) + '.html'), outpath) render_boards(board['boards'], template_board, template_thread, outpath, title) diff --git a/templates/board.html.j2 b/templates/board.html.j2 index 9b0e63f..b279fc9 100644 --- a/templates/board.html.j2 +++ b/templates/board.html.j2 @@ -7,6 +7,10 @@ {{ title }} + +
{% if board.boards |length > 0 %}