Add OpenSearch for searching mods in browser bar (#337)

For more about what OpenSearch is, see [here](https://developer.mozilla.org/en-US/docs/Web/OpenSearch).
This commit is contained in:
Emma 2022-01-12 11:37:45 -05:00 committed by GitHub
parent b5f438aa0c
commit ff48f08241
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -115,6 +115,12 @@ export default {
rel: 'stylesheet',
href: 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;800&display=swap',
},
{
rel: 'search',
type: 'application/opensearchdescription+xml',
href: '/opensearch.xml',
title: 'Modrinth mods',
},
],
script: [],
},

11
static/opensearch.xml Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>Modrinth mods</ShortName>
<Description>Search for mods on Modrinth, the open source modding platform.</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/x-icon">https://modrinth.com/favicon.ico</Image>
<Url type="text/html" method="get" template="https://modrinth.com/mods?q={searchTerms}"/>
<Developer>Guavy LLC</Developer>
<Attribution>Guavy LLC</Attribution>
<moz:SearchForm>https://modrinth.com/mods</moz:SearchForm>
</OpenSearchDescription>