Skip to content

Commit

Permalink
feat: support for OpenSearch (#808)
Browse files Browse the repository at this point in the history
Closes #457 

When we open the site in Firefox's search field, we can see that new
suggestions appear.

![image](https://github.com/user-attachments/assets/5bf3f93e-00e8-4f95-915a-e2e1ec72c062)
  • Loading branch information
ryuapp authored Nov 7, 2024
1 parent 992fef8 commit 563c08a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions frontend/routes/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ export default async function App(
type="image/svg+xml"
href={asset("/logo-square.svg")}
/>
<link
rel="search"
type="application/opensearchdescription+xml"
href="/opensearch.xml"
title="JSR"
/>
</head>
<body>
<Component />
Expand Down
9 changes: 9 additions & 0 deletions frontend/static/opensearch.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?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>JSR</ShortName>
<Description>Search for packages on JSR</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/x-icon">https://jsr.io/favicon.ico</Image>
<Url type="text/html" method="get" template="https://jsr.io/packages?search={searchTerms}"/>
<moz:SearchForm>https://jsr.io</moz:SearchForm>
</OpenSearchDescription>

0 comments on commit 563c08a

Please sign in to comment.