Fixed atom feeds
This commit is contained in:
parent
7d1b88f55a
commit
8dc59bf113
@ -26,6 +26,7 @@ import Yesod
|
|||||||
import Data.Time.Clock (UTCTime)
|
import Data.Time.Clock (UTCTime)
|
||||||
import Web.Encodings (formatW3)
|
import Web.Encodings (formatW3)
|
||||||
import Text.Hamlet.Monad
|
import Text.Hamlet.Monad
|
||||||
|
import Text.Hamlet.Quasi
|
||||||
|
|
||||||
newtype RepAtom = RepAtom Content
|
newtype RepAtom = RepAtom Content
|
||||||
instance HasReps RepAtom where
|
instance HasReps RepAtom where
|
||||||
@ -53,7 +54,8 @@ xmlns :: AtomFeed url -> HtmlContent
|
|||||||
xmlns _ = cs "http://www.w3.org/2005/Atom"
|
xmlns _ = cs "http://www.w3.org/2005/Atom"
|
||||||
|
|
||||||
template :: AtomFeed url -> Hamlet url IO ()
|
template :: AtomFeed url -> Hamlet url IO ()
|
||||||
template arg = [$hamlet|
|
template arg = [$xhamlet|
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
%feed!xmlns=$xmlns.arg$
|
%feed!xmlns=$xmlns.arg$
|
||||||
%title $cs.atomTitle.arg$
|
%title $cs.atomTitle.arg$
|
||||||
%link!rel=self!href=@atomLinkSelf.arg@
|
%link!rel=self!href=@atomLinkSelf.arg@
|
||||||
@ -65,7 +67,7 @@ template arg = [$hamlet|
|
|||||||
|]
|
|]
|
||||||
|
|
||||||
entryTemplate :: AtomFeedEntry url -> Hamlet url IO ()
|
entryTemplate :: AtomFeedEntry url -> Hamlet url IO ()
|
||||||
entryTemplate arg = [$hamlet|
|
entryTemplate arg = [$xhamlet|
|
||||||
%entry
|
%entry
|
||||||
%id @atomEntryLink.arg@
|
%id @atomEntryLink.arg@
|
||||||
%link!href=@atomEntryLink.arg@
|
%link!href=@atomEntryLink.arg@
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user