diff --git a/handlers.py b/handlers.py index 841fe0f..4ef8939 100644 --- a/handlers.py +++ b/handlers.py @@ -6,11 +6,11 @@ from templates import esc, snippet, wrap_page, DEFAULT_TEMPLATE from rns_client import fetch_remote_sites -def _respond(body_html, status=200): +def _respond(body_html, status=200, use_default=False): return { "status": status, "content_type": "text/html; charset=utf-8", - "body": wrap_page(body_html), + "body": wrap_page(body_html, use_default=use_default), "headers": {}, } @@ -386,7 +386,8 @@ def handle_style_form(msg="", query=None): f"
Drag this link to your bookmarks bar. Click it on any page to index it instantly.
" f'' f"{msg}
" - f'back' + f'back', + use_default=True, ) diff --git a/index.db b/index.db index eaa39d2..e9cae1f 100644 Binary files a/index.db and b/index.db differ diff --git a/templates.py b/templates.py index 870add5..372e736 100644 --- a/templates.py +++ b/templates.py @@ -30,8 +30,11 @@ def _default_template(): ) -def wrap_page(body_html): - template = get_setting("custom_template") or _default_template() - if "{{content}}" not in template: +def wrap_page(body_html, use_default=False): + if use_default: template = _default_template() + else: + template = get_setting("custom_template") or _default_template() + if "{{content}}" not in template: + template = _default_template() return template.replace("{{content}}", body_html)