added Changelog and cleaned Yesod/Commen remnants

This commit is contained in:
nek0 2015-09-30 15:24:56 +02:00
parent 6be3ecf9a5
commit fea89a933f
4 changed files with 23 additions and 11 deletions

View File

@ -0,0 +1,23 @@
#Changelog
##2015-09-30:
###Yesod/FeedTypes.hs
* added `feedLogo` field to `Feed` type as `Maybe (url, Text)`. Should this field result in `Nothing`, nothing will be added to the feed.
* `url`: Defines the URL to the logi image
* `Text`: Is the description of the logo image. Will only be used for RSS feeds
* added `feedEntryEnclosure` field to `FeedEntry` type as `Maybe (url, Int, Text)`. Should this field result in `Nothing`, no data will be added to the feed entry.
* `url`: Defines the URL to the enclosed data
* `Int`: Is the content size in bytes. RSS requires this.
* `Text`: Is the MIME-type of the enclosed file. RSS requires this
###Yesod/AtomFeed.hs
* modified `template` function to append an `<logo>url</logo>` tag at the end of the feed, when the provided `feedLogo` is not `Nothing`. This might look awkward, since it will be appended *after* the entries.
* modified `entryTemplate` to append an `<link rel="enclosure" href=url>` to the feed entry.
###Yesod/RssFeed.hs
* modified `template` function to append an `<image>` tag with its three required components `<url>`, `<title>` and `<link>`. `<url>` and `<title>` will be filled from `feedLogo`, `<link>` will be `feedLinkHome`.
* modified `entryTemplate` function to append an `<enclosure type=mime length=length url=url>` to the feed entry

View File

@ -28,7 +28,6 @@ module Yesod.AtomFeed
import Yesod.Core import Yesod.Core
import Yesod.FeedTypes import Yesod.FeedTypes
import Yesod.Common
import Text.Hamlet (hamlet) import Text.Hamlet (hamlet)
import qualified Data.ByteString.Char8 as S8 import qualified Data.ByteString.Char8 as S8
import Data.Text (Text) import Data.Text (Text)

View File

@ -1,9 +0,0 @@
module Yesod.Common
( removeItem
) where
removeItem :: Eq a => a -> [a] -> [a]
removeItem _ [] = []
removeItem r (x:xs)
| r == x = removeItem r xs
| otherwise = x : removeItem r xs

View File

@ -24,7 +24,6 @@ module Yesod.RssFeed
import Yesod.Core import Yesod.Core
import Yesod.FeedTypes import Yesod.FeedTypes
import Yesod.Common
import Text.Hamlet (hamlet) import Text.Hamlet (hamlet)
import qualified Data.ByteString.Char8 as S8 import qualified Data.ByteString.Char8 as S8
import Data.Text (Text, pack) import Data.Text (Text, pack)