Merge pull request #4448 from critcola/master

OpenSearch improvements, including Firefox bug fix
This commit is contained in:
Guo Xiang Tan 2016-09-20 12:45:25 +08:00 committed by GitHub
commit a85f1dc473
2 changed files with 11 additions and 9 deletions

View File

@ -17,4 +17,4 @@
<% end %> <% end %>
<%= canonical_link_tag %> <%= canonical_link_tag %>
<%= render_sitelinks_search_tag %> <%= render_sitelinks_search_tag %>
<link rel="search" type="application/opensearchdescription+xml" href="<%= Discourse.base_url %>/opensearch.xml"> <link rel="search" type="application/opensearchdescription+xml" href="<%= Discourse.base_url %>/opensearch.xml" title="<%= SiteSetting.title %> Search">

View File

@ -1,12 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName><%= SiteSetting.title %> Search</ShortName> <ShortName><%= SiteSetting.title %> Search</ShortName>
<Description>Search for posts on <%= SiteSetting.title %></Description> <Description>Search for posts on <%= SiteSetting.title %></Description>
<Tags>discourse forum</Tags> <Tags>discourse forum</Tags>
<% if SiteSetting.favicon_url =~ /\.ico$/ -%> <% if SiteSetting.favicon_url =~ /\.ico$/ -%>
<Image height="16" width="16" type="image/vnd.microsoft.icon"><%= UrlHelper.absolute SiteSetting.favicon_url %></Image> <Image height="16" width="16" type="image/vnd.microsoft.icon"><%= UrlHelper.absolute SiteSetting.favicon_url %></Image>
<%- else -%> <%- else -%>
<Image type="image/png"><%= UrlHelper.absolute SiteSetting.favicon_url %></Image> <Image type="image/png"><%= UrlHelper.absolute SiteSetting.favicon_url %></Image>
<%- end %> <%- end %>
<Url type="text/html" method="get" template="<%= Discourse.base_url %>/search?q={searchTerms}"/> <Url type="application/opensearchdescription+xml" rel="self" template="<%= Discourse.base_url %>/opensearch.xml"/>
<Query role="example" searchTerms="search term"/> <Url type="text/html" template="<%= Discourse.base_url %>/search?q={searchTerms}"/>
<Query role="example" searchTerms="search term"/>
</OpenSearchDescription> </OpenSearchDescription>