mirror of https://github.com/kiwix/libkiwix.git
Add searchdescription.xml endpoint
This commit is contained in:
parent
e5df5e936f
commit
5d6b0ea96a
|
@ -519,6 +519,14 @@ std::unique_ptr<Response> InternalServer::handle_request(const RequestContext& r
|
|||
if (request.get_url() == "/search")
|
||||
return handle_search(request);
|
||||
|
||||
if (request.get_url() == "/search/searchdescription.xml") {
|
||||
return ContentResponse::build(
|
||||
*this,
|
||||
RESOURCE::ft_opensearchdescription_xml,
|
||||
get_default_data(),
|
||||
"application/opensearchdescription+xml");
|
||||
}
|
||||
|
||||
if (request.get_url() == "/suggest")
|
||||
return handle_suggest(request);
|
||||
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<ShortName>Fulltext articles search</ShortName>
|
||||
<Description>Search for articles in the Library.</Description>
|
||||
<Url type="application/atom+xml;profile=opds-catalog"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
xmlns:k="http://kiwix.org/opensearchextension/1.0"
|
||||
indexOffset="0"
|
||||
template="{{root}}/search?format=xml&pattern={searchTerms}&books.filter.lang={language?}&books.name={k:name?}&pageLength={count?}&start={startIndex?}"/>
|
||||
</OpenSearchDescription>
|
|
@ -50,4 +50,5 @@ templates/catalog_v2_categories.xml
|
|||
templates/catalog_v2_languages.xml
|
||||
templates/url_of_search_results_css
|
||||
opensearchdescription.xml
|
||||
ft_opensearchdescription.xml
|
||||
catalog_v2_searchdescription.xml
|
||||
|
|
Loading…
Reference in New Issue