removed QQ hacks from yesod-newsfeed
This commit is contained in:
parent
f4e743e50d
commit
6155e135b0
@ -1,5 +1,4 @@
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
{-# LANGUAGE CPP #-}
|
||||
---------------------------------------------------------
|
||||
--
|
||||
-- Module : Yesod.AtomFeed
|
||||
@ -36,12 +35,7 @@ atomFeed :: Feed (Route master) -> GHandler sub master RepAtom
|
||||
atomFeed = liftM RepAtom . hamletToContent . template
|
||||
|
||||
template :: Feed url -> HtmlUrl url
|
||||
template arg =
|
||||
#if __GLASGOW_HASKELL__ >= 700
|
||||
[xhamlet|
|
||||
#else
|
||||
[$xhamlet|
|
||||
#endif
|
||||
template arg = [xhamlet|
|
||||
\<?xml version="1.0" encoding="utf-8"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom"
|
||||
<title>#{feedTitle arg}
|
||||
@ -54,12 +48,7 @@ template arg =
|
||||
|]
|
||||
|
||||
entryTemplate :: FeedEntry url -> HtmlUrl url
|
||||
entryTemplate arg =
|
||||
#if __GLASGOW_HASKELL__ >= 700
|
||||
[xhamlet|
|
||||
#else
|
||||
[$xhamlet|
|
||||
#endif
|
||||
entryTemplate arg = [xhamlet|
|
||||
<entry
|
||||
<id>@{feedEntryLink arg}
|
||||
<link href=@{feedEntryLink arg}
|
||||
@ -75,11 +64,6 @@ entryTemplate arg =
|
||||
atomLink :: Route m
|
||||
-> String -- ^ title
|
||||
-> GWidget s m ()
|
||||
atomLink r title = addHamletHead
|
||||
#if __GLASGOW_HASKELL__ >= 700
|
||||
[hamlet|
|
||||
#else
|
||||
[$hamlet|
|
||||
#endif
|
||||
atomLink r title = addHamletHead [hamlet|
|
||||
<link href=@{r} type=#{S8.unpack typeAtom} rel="alternate" title=#{title}
|
||||
|]
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
{-# LANGUAGE CPP #-}
|
||||
-------------------------------------------------------------------------------
|
||||
--
|
||||
-- Module : Yesod.RssFeed
|
||||
@ -33,12 +32,7 @@ rssFeed :: Feed (Route master) -> GHandler sub master RepRss
|
||||
rssFeed = liftM RepRss . hamletToContent . template
|
||||
|
||||
template :: Feed url -> HtmlUrl url
|
||||
template arg =
|
||||
#if __GLASGOW_HASKELL__ >= 700
|
||||
[xhamlet|
|
||||
#else
|
||||
[$xhamlet|
|
||||
#endif
|
||||
template arg = [xhamlet|
|
||||
\<?xml version="1.0" encoding="utf-8"?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
<channel
|
||||
@ -54,12 +48,7 @@ template arg =
|
||||
|]
|
||||
|
||||
entryTemplate :: FeedEntry url -> HtmlUrl url
|
||||
entryTemplate arg =
|
||||
#if __GLASGOW_HASKELL__ >= 700
|
||||
[xhamlet|
|
||||
#else
|
||||
[$xhamlet|
|
||||
#endif
|
||||
entryTemplate arg = [xhamlet|
|
||||
<item
|
||||
<title> #{feedEntryTitle arg}
|
||||
<link> @{feedEntryLink arg}
|
||||
@ -72,11 +61,6 @@ entryTemplate arg =
|
||||
rssLink :: Route m
|
||||
-> String -- ^ title
|
||||
-> GWidget s m ()
|
||||
rssLink r title = addHamletHead
|
||||
#if __GLASGOW_HASKELL__ >= 700
|
||||
[hamlet|
|
||||
#else
|
||||
[$hamlet|
|
||||
#endif
|
||||
rssLink r title = addHamletHead [hamlet|
|
||||
<link href=@{r} type=#{S8.unpack typeRss} rel="alternate" title=#{title}
|
||||
|]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user