aboutsummaryrefslogtreecommitdiff
path: root/src/Config.hs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-07-24 22:34:04 +0200
committermetamuffin <metamuffin@disroot.org>2023-07-24 22:34:04 +0200
commit99e23a8fc293d496dec270c556068698f4accb7f (patch)
tree6b18e909c947c113c6776ae20d72d0b2984ddf35 /src/Config.hs
parent1f639b98e07bcb4f7901e678e670894fbc370d8f (diff)
parentcf1d61b67ccd8336dce87b076379a787ba231102 (diff)
downloadfastbangs-99e23a8fc293d496dec270c556068698f4accb7f.tar
fastbangs-99e23a8fc293d496dec270c556068698f4accb7f.tar.bz2
fastbangs-99e23a8fc293d496dec270c556068698f4accb7f.tar.zst
Merge branch 'main' of codeberg.org:lialenck/bangs-ddgless
Diffstat (limited to 'src/Config.hs')
-rw-r--r--src/Config.hs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Config.hs b/src/Config.hs
new file mode 100644
index 0000000..d19e608
--- /dev/null
+++ b/src/Config.hs
@@ -0,0 +1,27 @@
+{-# LANGUAGE OverloadedStrings #-}
+
+module Config (
+ baseUrl,
+ makeOpenSearch
+) where
+
+import Data.String (IsString)
+
+baseUrl :: IsString s => s
+baseUrl = "http://localhost:20546"
+
+faviconUrl :: IsString s => s
+faviconUrl = "https://69owo.de/favicon.ico"
+
+makeOpenSearch :: (IsString s, Semigroup s) => s -> s
+makeOpenSearch searchUrl =
+ "<OpenSearchDescription xmlns=\"http://a9.com/-/spec/opensearch/1.1/\"\n"
+ <> " xmlns:moz=\"http://www.mozilla.org/2006/browser/search/\">\n"
+ <> " <ShortName>Banger</ShortName>\n"
+ <> " <Description>Bangs von ddg, ohne ddg</Description>\n"
+ <> " <InputEncoding>UTF-8</InputEncoding>\n"
+ <> " <Image width=\"16\" height=\"16\" type=\"image/x-icon\">" <> faviconUrl <> "</Image>\n"
+ <> " <Url type=\"text/html\" template=\"" <> searchUrl <> "\"/>\n"
+ <> " <!--<Url type=\"application/x-suggestions+json\" template=\"[suggestionURL]\"/>-->\n"
+ <> " <!--<moz:SearchForm>[https://example.com/search]</moz:SearchForm>-->\n"
+ <> "</OpenSearchDescription>\n"