2020-06-09 15:21:29 +02:00
|
|
|
{-# LANGUAGE NamedFieldPuns #-}
|
2020-06-08 22:45:16 +02:00
|
|
|
module Mock.Blog (
|
2020-06-09 17:45:54 +02:00
|
|
|
noCards
|
2020-06-09 15:21:29 +02:00
|
|
|
, noRSS
|
2020-06-09 17:45:54 +02:00
|
|
|
, simple
|
2020-06-08 22:45:16 +02:00
|
|
|
) where
|
|
|
|
|
2020-06-09 15:21:29 +02:00
|
|
|
import Blog (Blog(..))
|
|
|
|
import qualified Data.Map as Map (fromList)
|
|
|
|
import qualified Data.Set as Set (fromList)
|
|
|
|
import qualified Mock.Article (simple)
|
|
|
|
import qualified Mock.Blog.Path (simple)
|
|
|
|
import qualified Mock.Blog.Skin (simple)
|
|
|
|
import qualified Mock.Blog.Template (simple)
|
2020-06-09 17:45:54 +02:00
|
|
|
import qualified Mock.Blog.URL (simple, noCards)
|
2020-06-09 15:21:29 +02:00
|
|
|
import qualified Mock.Blog.Wording (defaultWording)
|
2020-06-08 22:45:16 +02:00
|
|
|
|
2020-06-09 15:21:29 +02:00
|
|
|
simple :: IO Blog
|
|
|
|
simple =
|
|
|
|
let wording = Mock.Blog.Wording.defaultWording in do
|
|
|
|
templates <- Mock.Blog.Template.simple
|
|
|
|
return $ Blog {
|
|
|
|
articles = Map.fromList [("test", Mock.Article.simple)]
|
|
|
|
, hasRSS = True
|
|
|
|
, name = "The Test Blog"
|
|
|
|
, pages = Map.fromList []
|
|
|
|
, path = Mock.Blog.Path.simple
|
|
|
|
, skin = Mock.Blog.Skin.simple
|
|
|
|
, tags = Map.fromList [("testing", Set.fromList ["test"])]
|
|
|
|
, templates
|
|
|
|
, urls = Mock.Blog.URL.simple
|
|
|
|
, wording
|
|
|
|
}
|
|
|
|
|
2020-06-09 17:45:54 +02:00
|
|
|
noCards :: IO Blog
|
|
|
|
noCards = (\b -> b {urls = Mock.Blog.URL.noCards}) <$> simple
|
|
|
|
|
2020-06-09 15:21:29 +02:00
|
|
|
noRSS :: IO Blog
|
|
|
|
noRSS = (\b -> b {hasRSS = False}) <$> simple
|