Add OpenSearch XML description for browsers

This commit is contained in:
Liam 2024-06-02 01:04:42 -04:00
parent 7667aec145
commit a95df5ec42
3 changed files with 12 additions and 1 deletions

View file

@ -0,0 +1,10 @@
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Derpibooru</ShortName>
<Description>Derpibooru image search</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/x-icon">https://derpibooru.org/favicon.ico</Image>
<Image width="64" height="64" type="image/svg+xml">https://derpibooru.org/favicon.svg</Image>
<Url type="text/html" method="get" template="https://derpibooru.org/search">
<Param name="q" value="{searchTerms}"/>
</Url>
</OpenSearchDescription>

View file

@ -17,7 +17,7 @@ defmodule PhilomenaWeb do
and import those modules here.
"""
def static_paths, do: ~w(assets favicon.ico favicon.svg robots.txt)
def static_paths, do: ~w(assets favicon.ico favicon.svg robots.txt opensearch.xml)
def controller do
quote do

View file

@ -15,6 +15,7 @@ html lang="en"
link rel="stylesheet" href=dark_stylesheet_path() media="(prefers-color-scheme: dark)"
link rel="icon" href=~p"/favicon.ico" type="image/x-icon"
link rel="icon" href=~p"/favicon.svg" type="image/svg+xml"
link rel="search" type="application/opensearchdescription+xml" title="Derpibooru" href=~p"/opensearch.xml"
meta name="generator" content="philomena"
meta name="theme-color" content="#618fc3"
meta name="format-detection" content="telephone=no"