1
0
Fork 0

Merge pull request #1401 from bookwyrm-social/opensearch

Adds opensearch xml file
This commit is contained in:
Mouse Reeve 2021-09-27 19:48:53 -07:00 committed by GitHub
commit 0a37556941
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 1 deletions

View file

@ -128,3 +128,14 @@ def peers(_):
def host_meta(request):
"""meta of the host"""
return TemplateResponse(request, "host_meta.xml", {"DOMAIN": DOMAIN})
@require_GET
def opensearch(request):
"""Open Search xml spec"""
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}
)