From c32f975a671b44efac8e04e4aaa0be798199227d Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 27 Sep 2021 19:28:50 -0700 Subject: [PATCH] Working in firefox --- bookwyrm/templates/opensearch.xml | 25 ++++++++----------------- bookwyrm/views/wellknown.py | 5 ++++- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/bookwyrm/templates/opensearch.xml b/bookwyrm/templates/opensearch.xml index 9582cdb7..651958ab 100644 --- a/bookwyrm/templates/opensearch.xml +++ b/bookwyrm/templates/opensearch.xml @@ -1,25 +1,16 @@ -{% load i18n %} -{% load static %} - +{% load i18n %}{% load static %} BW {% blocktrans trimmed with site_name=site.name %} {{ site_name }} search {% endblocktrans %} - UTF-8 - {% if site.favicon %} - {% get_media_prefix %}{{ site.favicon }}{% else %}{% static "images/favicon.ico" %} - {% endif %} - - - - {% url 'search' %} + {{ image }} + diff --git a/bookwyrm/views/wellknown.py b/bookwyrm/views/wellknown.py index a30cfb9f..8b55eaa3 100644 --- a/bookwyrm/views/wellknown.py +++ b/bookwyrm/views/wellknown.py @@ -135,4 +135,7 @@ def host_meta(request): @require_GET def opensearch(request): """Open Search xml spec""" - return TemplateResponse(request, "opensearch.xml") + site = models.SiteSettings.get() + logo_path = site.favicon or "images/favicon.png" + logo = f"{MEDIA_FULL_URL}{logo_path}" + return TemplateResponse(request, "opensearch.xml", {"image": logo, "DOMAIN": DOMAIN})