mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-23 10:01:04 +00:00
Working in firefox
This commit is contained in:
parent
99ef81be9b
commit
c32f975a67
2 changed files with 12 additions and 18 deletions
|
@ -1,25 +1,16 @@
|
|||
{% load i18n %}
|
||||
{% load static %}
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
{% load i18n %}{% load static %}<?xml version="1.0" encoding="UTF-8"?>
|
||||
<OpenSearchDescription
|
||||
xmlns="http://a9.com/-/spec/opensearch/1.1/"
|
||||
xmlns
|
||||
moz="http://www.mozilla.org/2006/browser/search/"
|
||||
xmlns:moz="http://www.mozilla.org/2006/browser/search/"
|
||||
>
|
||||
<ShortName>BW</ShortName>
|
||||
<Description>{% blocktrans trimmed with site_name=site.name %}
|
||||
{{ site_name }} search
|
||||
{% endblocktrans %}</Description>
|
||||
<InputEncoding>UTF-8</InputEncoding>
|
||||
<Image
|
||||
width="16"
|
||||
height="16"
|
||||
type="image/x-icon"
|
||||
>{% if site.favicon %}
|
||||
{% get_media_prefix %}{{ site.favicon }}{% else %}{% static "images/favicon.ico" %}
|
||||
{% endif %}</Image>
|
||||
<Url type="text/html" template="{% url 'search' %}">
|
||||
<Param name="q" value="{searchTerms}"/>
|
||||
</Url>
|
||||
<moz:SearchForm>{% url 'search' %}</moz:SearchForm>
|
||||
<Image width="16" height="16" type="image/x-icon">{{ image }}</Image>
|
||||
<Url
|
||||
type="text/html"
|
||||
method="get"
|
||||
template="https://{{ DOMAIN }}{% url 'search' %}?q={searchTerms}"
|
||||
/>
|
||||
</OpenSearchDescription>
|
||||
|
|
|
@ -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})
|
||||
|
|
Loading…
Reference in a new issue