Skip to content
Permalink
Browse files

Update Hierarchical-routes-and-breadcrumbs.md

Changed RepHtml to Html
Changed  myLayout :: GWidget s App () -> GHandler s App RepHtml
   to myLayout :: Widget -> Handler Html
Changed hamletToRepHtml to withUrlRenderer
  • Loading branch information...
teuffy committed Feb 25, 2017
1 parent 4bdd0a1 commit f2c539fe90121119dd5f3e52419ab401542a0a3f
Showing with 9 additions and 8 deletions.
  1. +9 −8 cookbook/Hierarchical-routes-and-breadcrumbs.md
@@ -45,7 +45,7 @@ instance YesodBreadcrumbs App where
breadcrumb (UKR UKRootR) = return ("UK", Just RootR)
breadcrumb (AdminR AdminRootR) = return ("Admin", Just RootR)
getRootR :: Handler RepHtml
getRootR :: Handler Html
getRootR = defaultLayout [whamlet|$newline never
<h1>Homepage
<p>
@@ -61,32 +61,33 @@ getRootR = defaultLayout [whamlet|$newline never
\.
|]
getAdminRootR :: Handler RepHtml
getAdminRootR :: Handler Html
getAdminRootR = do
defaultLayout $ do
[whamlet|$newline never
<h1>Admin
|]
getNLRootR :: Handler RepHtml
getNLRootR :: Handler Html
getNLRootR = do
defaultLayout $ do
[whamlet|$newline never
<h1>NL
|]
getUKRootR :: Handler RepHtml
getUKRootR :: Handler Html
getUKRootR = do
defaultLayout $ do
[whamlet|$newline never
<h1>UK
|]
myLayout :: GWidget s App () -> GHandler s App RepHtml
--myLayout :: GWidget s App () -> GHandler s App RepHtml
myLayout :: Widget -> Handler Html
myLayout widget = do
(title, parents) <- breadcrumbs
pc <- widgetToPageContent widget
hamletToRepHtml [hamlet|$newline never
withUrlRenderer [hamlet|$newline never
$doctype 5
<html>
<head>
@@ -118,5 +119,5 @@ $doctype 5
^{pageBody pc}
|]
main = warpDebug 3000 $ App
```
main = warp 3000 $ App
```

0 comments on commit f2c539f

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