lazd/mdn.io

Create a simple index page with OpenSearch metadata

Open

#18 aberto em 3 de jul. de 2019

Ver no GitHub
 (2 comments) (1 reaction) (0 assignees)JavaScript (9 forks)github user discovery
help wanted

Métricas do repositório

Stars
 (219 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

With this metadata browsers can suggest to add mdn.io as a search engine.

For example, here is how Firefox presents it: https://support.mozilla.org/en-US/kb/add-or-remove-search-engine-firefox#w_add-a-search-engine-from-the-address-bar

To add it, simply add in your index page:

<link rel="search"
      type="application/opensearchdescription+xml"
      href="https://mdn.io/opensearch.xml"
      title="MDN Web Docs"
/>

And host /opensearch.xml that should be something like this:

<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
                       xmlns:moz="http:/www.mozilla.org/2006/browser/search/"
>
    <ShortName>MDN Web Docs</ShortName>
    <Description>Search MDN Web Docs</Description>
    <InputEncoding>UTF-8</InputEncoding>
    <Image width="16" height="16" type="image/png">
        https://developer.mozilla.org/static/img/favicon32.7f3da72dcea1.png
    </Image>
    <Url type="text/html" method="get" template="http://mdn.io/{searchTerms}" />
    <moz:SearchForm>http://mdn.io</moz:SearchForm>
</OpenSearchDescription>

More info here: https://developer.mozilla.org/en-US/docs/Web/OpenSearch

Guia do colaborador