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})