forked from glotcode/glot-www
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Home.hs
30 lines (25 loc) · 743 Bytes
/
Home.hs
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
28
29
30
module Handler.Home where
import Import
import Util.Handler (title)
import Widget.Languages (languagesWidget)
import Data.Function ((&))
import qualified Util.Handler as Handler
import qualified Glot.Language as Language
getHomeR :: Handler Html
getHomeR = do
defaultLayout $ do
App{..} <- getYesod
setTitle $ title "Home"
setDescription (metaDescription languages)
Handler.setCanonicalUrl HomeR
$(widgetFile "homepage")
metaDescription :: [Language.Language] -> Text
metaDescription languages =
[ "Run code online in the browser. "
, pack $ show $ length languages
, " languages supported: "
, languages
& map Language.name
& intercalate ","
]
& concat