Set <title> centrally in Foundation using breadcrumbs
This commit is contained in:
parent
7e8e557625
commit
65c5829a3f
1 changed files with 4 additions and 2 deletions
|
@ -27,7 +27,7 @@ import Yesod.Core.Types (Logger)
|
|||
|
||||
import qualified Yesod.Core.Unsafe as Unsafe
|
||||
--import qualified Data.CaseInsensitive as CI
|
||||
import Data.Text as T (pack)
|
||||
import Data.Text as T (pack, intercalate)
|
||||
--import qualified Data.Text.Encoding as TE
|
||||
|
||||
import Text.Jasmine.Local (discardm)
|
||||
|
@ -97,6 +97,7 @@ instance Yesod App where
|
|||
master <- getYesod
|
||||
mmsg <- getMessage
|
||||
mperson <- maybeAuth
|
||||
(title, bcs) <- breadcrumbs
|
||||
|
||||
-- We break up the default layout into two components:
|
||||
-- default-layout is the contents of the body tag, and
|
||||
|
@ -105,7 +106,8 @@ instance Yesod App where
|
|||
-- you to use normal widget features in default-layout.
|
||||
|
||||
pc <- widgetToPageContent $ do
|
||||
--addStylesheet $ StaticR css_bootstrap_css
|
||||
setTitle $ toHtml $
|
||||
T.intercalate " :: " (map snd bcs) <> " :: " <> title
|
||||
$(widgetFile "default-layout")
|
||||
withUrlRenderer $(hamletFile "templates/default-layout-wrapper.hamlet")
|
||||
|
||||
|
|
Loading…
Reference in a new issue