python 2.7 - Inserting images using Flask-FlastPages -
i have created blog using flask-flatpages , posts in markdown, challenge i'm having inserting images in blog post. traditional way of inserting images in markdown not working.
i tried without success:
 }})
here worked me. turns out flatpages_html_renderer needed achieve goal.
here code:
def my_renderer(text): prerendered_body = render_template_string(text) return pygmented_markdown(prerendered_body) app = flask(__name__) app.config['flatpages_html_renderer'] = my_renderer pages = flatpages(app)
this discussed on post: https://github.com/simonsapin/flask-flatpages/pull/1
Comments
Post a Comment