mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
Render the search result using (opensearch/atom) xml format.
This commit is contained in:
@ -34,6 +34,7 @@ skin/fonts/Roboto.ttf
|
||||
skin/block_external.js
|
||||
skin/search_results.css
|
||||
templates/search_result.html
|
||||
templates/search_result.xml
|
||||
templates/error.html
|
||||
templates/index.html
|
||||
templates/suggestion.json
|
||||
|
37
static/templates/search_result.xml
Normal file
37
static/templates/search_result.xml
Normal file
@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<rss version="2.0"
|
||||
xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>Search: {{query.pattern}}</title>
|
||||
<link>{{query.unpaginatedQuery}}&format=xml&start={{results.start}}&pageLength={{pagination.itemsPerPage}}</link>
|
||||
<description>Search result for {{query.pattern}}</description>
|
||||
<opensearch:totalResults>{{results.count}}</opensearch:totalResults>
|
||||
<opensearch:startIndex>{{results.start}}</opensearch:startIndex>
|
||||
<opensearch:itemsPerPage>{{pagination.itemsPerPage}}</opensearch:itemsPerPage>
|
||||
<atom:link rel="search" type="application/opensearchdescription+xml" href="{{protocolPrefix}}search/searchdescription.xml"/>
|
||||
<opensearch:Query role="request"
|
||||
searchTerms="{{query.pattern}}"{{#query.lang}}
|
||||
language="{{query.lang}}"{{/query.lang}}
|
||||
startIndex="{{results.start}}"
|
||||
count="{{pagination.itemsPerPage}}"
|
||||
/>
|
||||
{{#results.items}}
|
||||
<item>
|
||||
<title>{{title}}</title>
|
||||
<link>{{absolutePath}}</link>
|
||||
{{#snippet}}
|
||||
<description>{{>snippet}}...</description>
|
||||
{{/snippet}}
|
||||
{{#bookTitle}}
|
||||
<book>
|
||||
<title>{{bookTitle}}</title>
|
||||
</book>
|
||||
{{/bookTitle}}
|
||||
{{#wordCount}}
|
||||
<wordCount>{{wordCount}}</wordCount>
|
||||
{{/wordCount}}
|
||||
</item>
|
||||
{{/results.items}}
|
||||
</channel>
|
||||
</rss>
|
Reference in New Issue
Block a user