aboutsummaryrefslogtreecommitdiff
path: root/src/Config.hs
blob: d19e6082b73df81785442f0ebe6560d622621f68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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"