Skip to content

Commit e70da09

Browse files
committed
opensearch: Add opensearch manifest
OpenSearch is a standard that allows browsers to discover search engines. A special XML file with information about the search engine is linked from its webpage in a link tag. OpenSearch is supported by Firefox and (maybe) macOS Safari. It used to be supported by Chromium-based browsers, but that feature was deprecated. https://stackoverflow.com/questions/56400952/does-chrome-allow-auto-discovery-of-opensearch MDN Docs: https://developer.mozilla.org/en-US/docs/Web/XML/Guides/OpenSearch OpenSearch specification: https://github.com/dewitt/opensearch/blob/master/opensearch-1-1-draft-6.md
1 parent fc8106d commit e70da09

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

docker/000-default.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
<Directory /usr/local/elixir/static/>
99
AllowOverride None
1010
Require all granted
11+
<Files search.xml>
12+
ForceType "application/opensearchdescription+xml; charset=utf-8"
13+
</Files>
1114
</Directory>
1215
<VirtualHost *:80>
1316
ServerName MY_LOCAL_IP

static/search.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
3+
<ShortName>Elixir (Linux)</ShortName>
4+
<Description>Elixir Cross Referencer - Linux</Description>
5+
<InputEncoding>UTF-8</InputEncoding>
6+
<Image width="16" height="16" type="image/x-icon">https://elixir.bootlin.com/static/favicon.ico</Image>
7+
<Url rel="results" type="text/html" template="https://elixir.bootlin.com/linux/latest/A/ident/{searchTerms}"/>
8+
</OpenSearchDescription>

templates/layout.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
Elixir Cross Referencer - Explore source code in your browser - Particularly useful for the Linux kernel and other low-level projects in C/C++ (bootloaders, C libraries...)
1616
{%- endblock %}">
1717
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1" />
18+
<link rel="search" type="application/opensearchdescription+xml" title="Elixir" href="/static/search.xml" />
19+
1820
<link rel="stylesheet" href="/static/style.css?v=15">
1921

2022
<link rel="preload" href="/static/img/2penguins.svg" as="image" />

0 commit comments

Comments
 (0)