diff --git a/favicon/gen.hs b/favicon/gen.hs new file mode 100644 index 0000000..8e47571 --- /dev/null +++ b/favicon/gen.hs @@ -0,0 +1,21 @@ +{-# LANGUAGE +FlexibleContexts, +GADTs + #-} + +-- run as: ./gen -o favicon.png -w 32 -h 32 + +import Diagrams.Prelude +import Diagrams.Backend.Rasterific.CmdLine + +main = defaultMain icon + +icon :: Diagram B +icon = lines_ `atop` canvas_ + where + line_ = rect 14 3 # fc white . lw none + dot_ = circle 2 # fc white . lw none + line1 = alignL $ hsep 2 [line_, dot_] + line2 = alignL $ hsep 2 [dot_, line_] + lines_ = centerXY $ vsep 3 [line1, line2, line1] + canvas_ = roundedRect 32 32 4 # fc (sRGB24read "7868FF") . lw none diff --git a/favicon/gen.sh b/favicon/gen.sh new file mode 100755 index 0000000..c47877d --- /dev/null +++ b/favicon/gen.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# see https://github.com/audreyr/favicon-cheat-sheet + +# TODO: make larger icons for Android/iOS + +ghc gen.hs + +rm -f favicon.ico + +for n in 16 24 32 48 64 +do + echo "generating $n x $n" + ./gen -o "favicon-$n.png" -w "$n" -h "$n" + optipng -quiet -o7 "favicon-$n.png" +done + +convert favicon-*.png favicon.ico + +rm -f favicon-*.png gen gen.o gen.hi + +echo "" +echo "now move favicon.ico to static/" diff --git a/src/View.hs b/src/View.hs index d85b16f..6b494bb 100644 --- a/src/View.hs +++ b/src/View.hs @@ -532,6 +532,7 @@ wrapPage pageTitle page = doctypehtml_ $ do title_ (toHtml pageTitle) meta_ [name_ "viewport", content_ "width=device-width, initial-scale=1.0, user-scalable=yes"] + link_ [rel_ "shortcut icon", href_ "/favicon.ico"] token <- _googleToken <$> lift ask unless (T.null token) $ meta_ [name_ "google-site-verification", content_ token] diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000..a2e6e8f Binary files /dev/null and b/static/favicon.ico differ