Skip to content

Commit

Permalink
Add opensearch configs (#42)
Browse files Browse the repository at this point in the history
Allowing searches on simplified and traditional only for now.
 Future work could add search suggestions, searching Cantonese, etc.
  • Loading branch information
mreichhoff committed Jul 12, 2024
1 parent 53d2a94 commit 60b0da5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
<link rel="manifest" href="/manifest.json">
<link rel="icon" href="/images/favicon-32x32.png" type="image/x-icon">
<link rel="apple-touch-icon" href="/images/apple-touch-icon.png">
<link rel="search" type="application/opensearchdescription+xml" title="HanziGraph (simplified)" href="/opensearch-simplified.xml">
<link rel="search" type="application/opensearchdescription+xml" title="HanziGraph (traditional)" href="/opensearch-traditional.xml">
</head>

<body>
Expand Down
9 changes: 9 additions & 0 deletions public/opensearch-simplified.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>HanziGraph (simplified)</ShortName>
<Description></Description>
<InputEncoding>UTF-8</InputEncoding>
<!-- TODO: deferring any ability to switch out URLs...prod only for now -->
<Image width="16" height="16" type="image/x-icon">https://hanzigraph.com/images/favicon.ico</Image>
<Url type="text/html" template="https://hanzigraph.com/simplified/{searchTerms}"/>
</OpenSearchDescription>
9 changes: 9 additions & 0 deletions public/opensearch-traditional.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>HanziGraph (traditional)</ShortName>
<Description></Description>
<InputEncoding>UTF-8</InputEncoding>
<!-- TODO: deferring any ability to switch out URLs...prod only for now -->
<Image width="16" height="16" type="image/x-icon">https://hanzigraph.com/images/favicon.ico</Image>
<Url type="text/html" template="https://hanzigraph.com/traditional/{searchTerms}"/>
</OpenSearchDescription>

0 comments on commit 60b0da5

Please sign in to comment.