Skip to content
Permalink
Browse files

landing as root with empty layout

  • Loading branch information...
3v0k4 committed Jul 15, 2019
1 parent 5271b5f commit bb89035c9e4f4b9265bebe378ec38e932bc47bcd
Showing with 18 additions and 6 deletions.
  1. +2 −2 config/routes
  2. +8 −2 src/Handler/Landing.hs
  3. +5 −0 templates/empty-layout-wrapper.hamlet
  4. +2 −0 templates/empty-layout.hamlet
  5. +1 −2 templates/landing.hamlet
@@ -7,9 +7,9 @@
/favicon.ico FaviconR GET
/robots.txt RobotsR GET

/ HomeR GET POST
/home HomeR GET POST

/comments CommentR POST

/profile ProfileR GET
/landing LandingR GET
/ LandingR GET
@@ -7,9 +7,15 @@
module Handler.Landing where

import Import
import Text.Hamlet (hamletFile)

emptyLayout :: Widget -> Handler Html
emptyLayout widget = do
pc <- widgetToPageContent $ do
$(widgetFile "empty-layout")
withUrlRenderer $(hamletFile "templates/empty-layout-wrapper.hamlet")

getLandingR :: Handler Html
getLandingR = do
defaultLayout $ do
let interpolated = "interpolated string" :: Text
emptyLayout $ do
$(widgetFile "landing")
@@ -0,0 +1,5 @@
\<!doctype html>
<html>
<head>
<body>
^{pageBody pc}
@@ -0,0 +1,2 @@
<div .container>
^{widget}
@@ -1,2 +1 @@
<h1>
Landing #{interpolated}
<h1>Login

0 comments on commit bb89035

Please sign in to comment.
You can’t perform that action at this time.