diff --git a/src/Foundation.hs b/src/Foundation.hs index 2dc9fbc..2452bfe 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -264,3 +264,7 @@ unsafeHandler = Unsafe.fakeHandlerGetLogger appLogger -- https://github.com/yesodweb/yesod/wiki/Sending-email -- https://github.com/yesodweb/yesod/wiki/Serve-static-files-from-a-separate-domain -- https://github.com/yesodweb/yesod/wiki/i18n-messages-in-the-scaffolding +userProfile :: User -> Route App +userProfile user + | userUsername user == siteUsername compileTimeAppSettings = HomeR + | otherwise = error "Multiple profile pages are not yet supported" diff --git a/src/Handler/Entries.hs b/src/Handler/Entries.hs index f552667..8199a3a 100644 --- a/src/Handler/Entries.hs +++ b/src/Handler/Entries.hs @@ -1,4 +1,5 @@ {-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE OverloadedStrings #-} module Handler.Entries where @@ -33,8 +34,16 @@ renderEntry :: (Entity Entry) -> Handler Html renderEntry entry = do let correctRoute = entryR entry actualRoute <- getCurrentRoute + author <- getCached . entryAuthorId $ entityVal entry when (actualRoute /= Just correctRoute) $ redirectWith movedPermanently301 correctRoute defaultLayout $ do setTitle . toHtml . entryTitle . entityVal $ entry + toWidgetHead [hamlet| + + + + + + |] hEntry entry diff --git a/src/Widget/Card.hs b/src/Widget/Card.hs index c9ceddf..542ddd2 100644 --- a/src/Widget/Card.hs +++ b/src/Widget/Card.hs @@ -39,6 +39,7 @@ hCard (Entity userId user) = do + diff --git a/templates/default-layout-wrapper.hamlet b/templates/default-layout-wrapper.hamlet index a4c2d3a..68e2bbc 100644 --- a/templates/default-layout-wrapper.hamlet +++ b/templates/default-layout-wrapper.hamlet @@ -6,7 +6,6 @@ $doctype 5 #{fullTitle} - <meta property="og:title" content=#{fullTitle}> $maybe route <- mcurrentRoute <link rel="canonical" href=@{route}> <meta property="og:url" content=@{route}>