Files
linkding/bookmarks/views/opensearch.py
Johannes Zorn 9a00ae4b93 Add opensearch declaration (#1058)
* feat: Add opensearch declaration

* cleanup

---------

Co-authored-by: Johannes Zorn <johannes.zorn@zollsoft.com>
Co-authored-by: Sascha Ißbrücker <sascha.issbruecker@gmail.com>
2025-05-17 09:52:26 +02:00

19 lines
497 B
Python

from django.urls import reverse
from django.shortcuts import render
def opensearch(request):
base_url = request.build_absolute_uri(reverse("linkding:root"))
bookmarks_url = request.build_absolute_uri(reverse("linkding:bookmarks.index"))
return render(
request,
"opensearch.xml",
{
"base_url": base_url,
"bookmarks_url": bookmarks_url,
},
content_type="application/opensearchdescription+xml",
status=200,
)