mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-23 18:11:09 +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 i18n %}{% load static %}<?xml version="1.0" encoding="UTF-8"?>
|
||||||
{% load static %}
|
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<OpenSearchDescription
|
<OpenSearchDescription
|
||||||
xmlns="http://a9.com/-/spec/opensearch/1.1/"
|
xmlns="http://a9.com/-/spec/opensearch/1.1/"
|
||||||
xmlns
|
xmlns:moz="http://www.mozilla.org/2006/browser/search/"
|
||||||
moz="http://www.mozilla.org/2006/browser/search/"
|
|
||||||
>
|
>
|
||||||
<ShortName>BW</ShortName>
|
<ShortName>BW</ShortName>
|
||||||
<Description>{% blocktrans trimmed with site_name=site.name %}
|
<Description>{% blocktrans trimmed with site_name=site.name %}
|
||||||
{{ site_name }} search
|
{{ site_name }} search
|
||||||
{% endblocktrans %}</Description>
|
{% endblocktrans %}</Description>
|
||||||
<InputEncoding>UTF-8</InputEncoding>
|
<Image width="16" height="16" type="image/x-icon">{{ image }}</Image>
|
||||||
<Image
|
<Url
|
||||||
width="16"
|
type="text/html"
|
||||||
height="16"
|
method="get"
|
||||||
type="image/x-icon"
|
template="https://{{ DOMAIN }}{% url 'search' %}?q={searchTerms}"
|
||||||
>{% 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>
|
|
||||||
</OpenSearchDescription>
|
</OpenSearchDescription>
|
||||||
|
|
|
@ -135,4 +135,7 @@ def host_meta(request):
|
||||||
@require_GET
|
@require_GET
|
||||||
def opensearch(request):
|
def opensearch(request):
|
||||||
"""Open Search xml spec"""
|
"""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