Add OpenSearch specifications for both packages and options. (#190)

Fixes #186.
This commit is contained in:
Alexandre Macabies 2020-09-15 10:58:53 +02:00 committed by GitHub
parent 7f91e92d8f
commit 038ee96a5b
Failed to generate hash of commit
4 changed files with 27 additions and 2 deletions

View file

@ -0,0 +1,10 @@
<?xml version="1.0"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>NixOS options</ShortName>
<Description>Search NixOS options by name or description.</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/png">https://nixos.org/favicon.png</Image>
<Url type="text/html" template="https://search.nixos.org/options?query={searchTerms}"/>
<moz:SearchForm>https://search.nixos.org/options</moz:SearchForm>
</OpenSearchDescription>

View file

@ -0,0 +1,10 @@
<?xml version="1.0"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>NixOS packages</ShortName>
<Description>Search NixOS packages by name or description.</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/png">https://nixos.org/favicon.png</Image>
<Url type="text/html" template="https://search.nixos.org/packages?query={searchTerms}"/>
<moz:SearchForm>https://search.nixos.org/packages</moz:SearchForm>
</OpenSearchDescription>

View file

@ -20,6 +20,11 @@
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" />
<link rel="shortcut icon" type="image/png" href="https://nixos.org/favicon.png" />
<link rel="search" type="application/opensearchdescription+xml" title="NixOS packages"
href="/desc-search-packages.xml">
<link rel="search" type="application/opensearchdescription+xml" title="NixOS options"
href="/desc-search-options.xml">
</head>
<body>

View file

@ -38,7 +38,7 @@ var common = {
],
resolve: {
modules: [path.join(__dirname, "src"), "node_modules"],
extensions: [".js", ".elm", ".scss", ".png"]
extensions: [".js", ".elm", ".scss", ".png", ".xml"]
},
module: {
rules: [
@ -70,7 +70,7 @@ var common = {
}
},
{
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
test: /\.(ttf|eot|svg|xml)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
exclude: [/elm-stuff/, /node_modules/],
loader: "file-loader"
},