diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2016-02-11 22:43:34 +0100 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2016-02-11 22:43:34 +0100 |
| commit | d6c817be8dfb9d41ea3f19cecd90619cde97209d (patch) | |
| tree | e511903d2bfcf87f8d26da68fd4df529d33eaa3a /data | |
| parent | e43db7fd25798616ad38a959bd378bb765b9323c (diff) | |
| download | phinde-d6c817be8dfb9d41ea3f19cecd90619cde97209d.tar.gz phinde-d6c817be8dfb9d41ea3f19cecd90619cde97209d.zip | |
opensearch supportv0.1.0
Diffstat (limited to 'data')
| -rw-r--r-- | data/templates/base.htm | 1 | ||||
| -rw-r--r-- | data/templates/opensearch.htm | 21 | ||||
| -rw-r--r-- | data/templates/opensearchdescription.htm | 9 | ||||
| -rw-r--r-- | data/templates/search.htm | 2 |
4 files changed, 32 insertions, 1 deletions
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 @@ <link rel="stylesheet" href="css/phinde.css"/> <link rel="icon" href="favicon.ico"/> <meta name="generator" content="phinde" /> + <link rel="search" title="{{apptitle}}" type="application/opensearchdescription+xml" href="/opensearchdescription.php"/> {% block meta %}{% endblock %} </head> <body> 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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<feed xmlns="http://www.w3.org/2005/Atom" + xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"> + <title>"{{query}}" search results</title> + <link rel="self" href="{{fullUrl}}" type="application/atom+xml"/> + <updated>{{"now"|date("c")}}</updated> + <id>{{fullUrl}}</id> + <opensearch:totalResults>{{hitcount}}</opensearch:totalResults> + {% for hit in hits %} + {% set doc = hit._source %} + <entry> + <title>{{doc.title}}</title> + <link href="{{doc.url}}"/> + <id>{{doc.url}}</id> + {% if doc.modate %} + <updated>{{doc.modate|date('c')}}</updated> + {% endif %} + <content type="text">{{doc.htmlText|striptags}}</content> + </entry> + {% endfor %} +</feed> 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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> + <ShortName>{{apptitle}}</ShortName> + <Description>Search</Description> + <Url type="application/atom+xml" rel="results" + template="{{absBaseUrl}}?q={searchTerms}&page={startPage?}&format=opensearch"/> + <Url type="text/html" rel="results" method="get" + template="{{absBaseUrl}}?q={searchTerms}"/> +</OpenSearchDescription> 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 @@ <div class="container"> <ul class="nav"> <li> - <a class="brand" href="{{baseurl}}">{{apptitle}}</a> + <a class="brand" href="{{baseUrl}}">{{apptitle}}</a> </li> </ul> <form class="navbar-form pull-left"> |
