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>
This commit is contained in:
Johannes Zorn
2025-05-17 09:52:26 +02:00
committed by GitHub
parent da9371e33c
commit 9a00ae4b93
6 changed files with 54 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
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,
)