From: Christian Weiske Date: Thu, 11 Feb 2016 21:43:34 +0000 (+0100) Subject: opensearch support X-Git-Tag: v0.1.0 X-Git-Url: https://git.cweiske.de/phinde.git/commitdiff_plain/d6c817be8dfb9d41ea3f19cecd90619cde97209d?ds=sidebyside opensearch support --- diff --git a/README.rst b/README.rst index 3d10657..7977635 100644 --- a/README.rst +++ b/README.rst @@ -24,6 +24,7 @@ Features - Query: ``foo bar site:example.org/dir/`` - or use the ``site`` GET parameter: ``/?q=foo&site=example.org/dir`` +- OpenSearch support with HTML and Atom result lists ============ diff --git a/data/templates/base.htm b/data/templates/base.htm index f54cd0c..a497f01 100644 --- a/data/templates/base.htm +++ b/data/templates/base.htm @@ -9,6 +9,7 @@ + {% block meta %}{% endblock %} diff --git a/data/templates/opensearch.htm b/data/templates/opensearch.htm new file mode 100644 index 0000000..a1000f1 --- /dev/null +++ b/data/templates/opensearch.htm @@ -0,0 +1,21 @@ + + + "{{query}}" search results + + {{"now"|date("c")}} + {{fullUrl}} + {{hitcount}} + {% for hit in hits %} + {% set doc = hit._source %} + + {{doc.title}} + + {{doc.url}} + {% if doc.modate %} + {{doc.modate|date('c')}} + {% endif %} + {{doc.htmlText|striptags}} + + {% endfor %} + diff --git a/data/templates/opensearchdescription.htm b/data/templates/opensearchdescription.htm new file mode 100644 index 0000000..6bc2f96 --- /dev/null +++ b/data/templates/opensearchdescription.htm @@ -0,0 +1,9 @@ + + + {{apptitle}} + Search + + + diff --git a/data/templates/search.htm b/data/templates/search.htm index c7b1bb7..f0481a9 100644 --- a/data/templates/search.htm +++ b/data/templates/search.htm @@ -18,7 +18,7 @@