packages feed

hablo-1.1.0.1: test/Mock/Collection.hs

module Mock.Collection (
      main
    , testing
  ) where

import Blog (Blog(..), Path(..))
import Collection (Collection(..))
import Data.Map as Map (elems)
import qualified Mock.Blog (simple)
import System.FilePath ((</>))

main :: IO Collection
main = do
  blog <- Mock.Blog.simple
  return $ Collection {
      featured = Map.elems $ articles blog
    , basePath = root $ path blog
    , tag = Nothing
  }

testing :: IO Collection
testing = do
  blog <- Mock.Blog.simple
  return $ Collection {
      featured = Map.elems $ articles blog
    , basePath = root (path blog) </> "testing"
    , tag = Just "testing"
  }