Simplify site title handling, automatically suffix site title to all pages

This commit is contained in:
Danielle McLean 2017-10-09 13:50:26 +11:00
parent 4088735c69
commit 1b8a07a5f6
Signed by: 00dani
GPG key ID: 5A5D2D1AFF12EEC5
8 changed files with 17 additions and 13 deletions

View file

@ -15,14 +15,10 @@ import Widget.Feed ( hFeed )
getHomeR :: Handler Html
getHomeR = do
userE@(Entity userId user) <- runDB . getBy404 $ UniqueUser "dani"
maybeTitle <- asks $ appTitle . appSettings
title <- asks $ siteTitle . appSettings
entries <- runDB $ selectList [EntryAuthorId ==. userId] [Desc EntryPublished]
defaultLayout $ do
case maybeTitle of
Just title -> do
setTitle $ toHtml title
atomLink FeedR title
Nothing -> return ()
atomLink FeedR title
toWidgetHead
[hamlet|
<meta name="author" content=#{userFullName user}>