diff --git a/app.py b/app.py index 044d704..4e6eab9 100644 --- a/app.py +++ b/app.py @@ -33,7 +33,7 @@ try: except Exception: markdown_strikethrough = None -__version__ = '0.4-dev' +__version__ = '0.4' #### CONSTANTS #### @@ -510,7 +510,7 @@ forbidden_urls = [ 'create', 'edit', 'p', 'ajax', 'history', 'manage', 'static', 'media', 'accounts', 'tags', 'init-config', 'upload', 'upload-info', 'about', 'stats', 'terms', 'privacy', 'easter', 'search', 'help', 'circles', - 'protect', 'kt' + 'protect', 'kt', 'embed' ] @@ -519,8 +519,6 @@ app.secret_key = 'qrdldCcvamtdcnidmtasegasdsedrdqvtautar' app.url_map.converters['slug'] = SlugConverter - - #### ROUTES #### @app.before_request @@ -708,6 +706,16 @@ def view_unnamed(id): flash('The URL of this page is a reserved URL. Please change it.') return render_template('view.html', p=p, rev=p.latest) +@app.route('/embed//') +def embed_view(id): + try: + p = Page[id] + except Page.DoesNotExist: + return "", 404 + rev = p.latest + return "

{0}

{1}
".format( + html.escape(p.title), rev.html()) + @app.route('/p/most_recent/') @app.route('/p/most_recent//') def view_most_recent(page=1):