Avoid rendering Markdown when pushing entry content into the og:description, and also, add the standard meta description and meta author

This commit is contained in:
Danielle McLean 2017-10-15 22:34:05 +11:00
parent 3b00565bda
commit a0004946d6
Signed by: 00dani
GPG key ID: 5A5D2D1AFF12EEC5

View file

@ -9,6 +9,7 @@ import Yesod.AtomFeed ( atomLink )
import Model.Cache ( getCached )
import Model.Entry ( entryTitle )
import Model.Markdown ( unMarkdown )
import Widget.Entry ( entryR, hEntry )
import Widget.Feed ( hFeed )
@ -40,9 +41,12 @@ renderEntry entry = do
defaultLayout $ do
setTitle . toHtml . entryTitle . entityVal $ entry
toWidgetHead [hamlet|
<meta name="author" content=#{userFullName $ entityVal author}>
<link rel="author" href=@{userProfile $ entityVal author}>
<meta name="description" content=#{unMarkdown $ entryContent $ entityVal entry}>
<meta property="og:title" content=#{entryTitle $ entityVal entry}>
<meta property="og:type" content="article">
<meta property="og:description" content=#{entryContent $ entityVal entry}>
<meta property="og:description" content=#{unMarkdown $ entryContent $ entityVal entry}>
<meta property="article:author" content=@{userProfile $ entityVal author}>
<meta property="article:section" content=#{K.pluralise $ entryKind $ entityVal entry}>
|]