Mark up entry permalink pages with OpenGraph garbage too
This commit is contained in:
parent
47fe00a8b8
commit
2956550a6c
4 changed files with 14 additions and 1 deletions
|
|
@ -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|
|
||||
<meta property="og:title" content=#{entryTitle $ entityVal entry}>
|
||||
<meta property="og:type" content="article">
|
||||
<meta property="og:description" content=#{entryContent $ entityVal entry}>
|
||||
<meta property="article:author" content=@{userProfile $ entityVal author}>
|
||||
<meta property="article:section" content=#{K.pluralise $ entryKind $ entityVal entry}>
|
||||
|]
|
||||
hEntry entry
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue