diff --git a/i2p2www/blog/2012/12/17/I2P_0.9.4_released.rst b/i2p2www/blog/2012/12/17/I2P_0.9.4_released.rst index c4182af4..8b78409c 100644 --- a/i2p2www/blog/2012/12/17/I2P_0.9.4_released.rst +++ b/i2p2www/blog/2012/12/17/I2P_0.9.4_released.rst @@ -25,7 +25,7 @@ we will have more information for you when we release 0.9.5. Files are available on the `download page`_. -.. _`download page`: /download.html +.. _`download page`: {{ get_url('downloads_select') }} **RELEASE DETAILS** diff --git a/i2p2www/blog/helpers.py b/i2p2www/blog/helpers.py index f714b9d4..8ffadb85 100644 --- a/i2p2www/blog/helpers.py +++ b/i2p2www/blog/helpers.py @@ -1,7 +1,7 @@ import codecs import datetime from docutils.core import publish_parts -from flask import abort, g, safe_join, url_for +from flask import abort, g, render_template_string, safe_join, url_for import os import os.path @@ -93,7 +93,11 @@ def render_blog_post(slug): with codecs.open(path, encoding='utf-8') as fd: content = fd.read() - return publish_parts(source=content, source_path=BLOG_DIR, writer_name="html") + # render the post with Jinja2 to handle URLs etc. + rendered_content = render_template_string(content) + + # publish the post with docutils + return publish_parts(source=rendered_content, source_path=BLOG_DIR, writer_name="html") def get_metadata_from_meta(meta): metaLines = meta.split('\n')