-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathHandler.hs
More file actions
27 lines (19 loc) · 742 Bytes
/
Copy pathHandler.hs
File metadata and controls
27 lines (19 loc) · 742 Bytes
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
module Handler where
import Import
import Data.FileEmbed (embedFile)
import Handler.Helpers (render)
import Handler.Partials (searchHelp)
getHomeR :: Handler Html
getHomeR = defaultLayout $ do
setTitle "π-Base"
$(widgetFile "homepage")
getHelpR :: Handler Html
getHelpR = render "Help" $(widgetFile "help/site")
-- These handlers embed files in the executable at compile time to avoid a
-- runtime dependency, and for efficiency.
getFaviconR :: Handler TypedContent
getFaviconR = return $ TypedContent "image/x-icon"
$ toContent $(embedFile "config/favicon.ico")
getRobotsR :: Handler TypedContent
getRobotsR = return $ TypedContent typePlain
$ toContent $(embedFile "config/robots.txt")