scratchfoundation / scratch-www

Standalone web client for Scratch
https://scratch.mit.edu
BSD 3-Clause "New" or "Revised" License
1.58k stars 835 forks source link

Adding a <link rel="search"> tag (open search) #4166

Open BoomerScratch opened 4 years ago

BoomerScratch commented 4 years ago

This is used in the Scratch Wiki:

<link rel="search" type="application/opensearchdescription+xml" href="/w/opensearch_desc.php" title="Scratch Wiki (en)"/>

When the user has visited the Scratch Wiki once, and then types in "en.scratch-wiki.info" in the search bar, you see something like "Press tab to search Scratch Wiki (en)". Why not add it to scratch.mit.edu?

apple502j commented 4 years ago

note: it doesn't have to be php

BoomerScratch commented 4 years ago

@apple502j IKR, I copy and pasted it from the Scratch Wiki.

R4356th commented 4 years ago

The search can be done only on browsers using Chromium probably.

Kenny2github commented 4 years ago

I wasn't even aware that this was a thing! Yes, totally add it :D

BoomerScratch commented 4 years ago

Example <link> element we can use:

<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Scratch"/>

/opensearch.xml example (got most from GitHub's opensearch.xml):

<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>Scratch</ShortName>
<Description>Search Scratch</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/x-icon">https://scratch.mit.edu/favicon.ico</Image>
<Url type="text/html" method="get" template="https://github.com/search/projects?q={searchTerms}"/>
<moz:SearchForm>https://scratch.mit.edu/search/projects</moz:SearchForm>
</OpenSearchDescription>

Tell me if you got any feedback! 😄