OpenSearch For A Static-Hosted Websites Using Google-Search

Posted at

first let's download my OpenSearch XML,
click: opensearch.xml.

by the way... here is how to force-download of a file instead of opening it in the browser:
  <a type="application/octet-stream" download="opensearch.xml" title="opensearch.xml" 

change ShortName, Description, Tags, Image to reflect your website name/title.
You can encode your favicon.ico to a base64 through various tool including this:

Look around for <Param name="q" and change its value so the website will be your website. No need to escape or encode the address, it will be done automatically by the browser.

Declaring the link:

Put this inside your HTML-file's <HEAD>-part:

<link rel="search" type="application/opensearchdescription+xml" 
href="" title="Search" />

It's best that the webserver will serve that XML-file with mimetype of application/opensearchdescription+xml, instead of just text/xml,

But normally, if your websites is static, and hosted on GitHub-pages you do not have any control on the mimetype the web-server is using. you can try rename/include a copy of the same file and serve this one,
with a different name: opensearch.opensearchdescription+xml,
I'm not aware of any rule set by GitHub to change its mimetype to the file but it might happen ;|