Browse Source

GreenSite->Green

image-sizing
Logan McGrath 11 months ago
parent
commit
33d1501869
  1. 4
      app/author/Main.hs
  2. 4
      app/green/Main.hs
  3. 2
      app/site/Main.hs
  4. 86
      green.cabal
  5. 10
      hie.yaml
  6. 12
      package.yaml
  7. 20
      src/Green.hs
  8. 43
      src/Green/Command.hs
  9. 42
      src/Green/Common.hs
  10. 2
      src/Green/Compiler.hs
  11. 4
      src/Green/Compiler/Layout.hs
  12. 4
      src/Green/Compiler/Pandoc.hs
  13. 4
      src/Green/Config.hs
  14. 20
      src/Green/Context.hs
  15. 6
      src/Green/Context/Field.hs
  16. 2
      src/Green/Context/GitCommits.hs
  17. 2
      src/Green/Context/Post.hs
  18. 2
      src/Green/Context/Tag.hs
  19. 2
      src/Green/Lens.hs
  20. 4
      src/Green/Lens/Hakyll.hs
  21. 2
      src/Green/Route.hs
  22. 20
      src/Green/Rule.hs
  23. 4
      src/Green/Rule/Blog.hs
  24. 6
      src/Green/Rule/Feed.hs
  25. 2
      src/Green/Rule/Js.hs
  26. 4
      src/Green/Rule/Page.hs
  27. 4
      src/Green/Rule/Robot.hs
  28. 4
      src/Green/Rule/Sass.hs
  29. 6
      src/Green/Rule/Sitemap.hs
  30. 2
      src/Green/Util.hs
  31. 40
      src/GreenSite/Command.hs
  32. 6
      test/Green/Compiler/LayoutSpec.hs
  33. 4
      test/Green/RouteSpec.hs
  34. 6
      test/Green/Rule/BlogSpec.hs
  35. 22
      test/Green/TestSupport.hs
  36. 4
      test/Green/TestSupport/Compiler.hs
  37. 4
      test/Green/TestSupport/Config.hs
  38. 2
      test/Green/TestSupport/Resource.hs
  39. 6
      test/Green/TestSupport/Routes.hs
  40. 6
      test/Green/TestSupport/TestEnv.hs
  41. 22
      test/GreenSite/TestSupport.hs

4
app/author/Main.hs

@ -0,0 +1,4 @@
import Green
main :: IO ()
main = author

4
app/green/Main.hs

@ -1,4 +0,0 @@
import GreenSite
main :: IO ()
main = green

2
app/site/Main.hs

@ -1,4 +1,4 @@
import GreenSite
import Green
main :: IO ()
main = site

86
green-site.cabal → green.cabal

@ -4,7 +4,7 @@ cabal-version: 1.12
--
-- see: https://github.com/sol/hpack
name: green-site
name: green
version: 0.1.0.0
description: Please see the README at <https://github.com/ThisFieldWasGreen/thisfieldwasgreen.github.io#readme>
homepage: https://github.com/ThisFieldWasGreen/thisfieldwasgreen.github.io#readme
@ -23,32 +23,32 @@ source-repository head
library
exposed-modules:
GreenSite
GreenSite.Command
GreenSite.Common
GreenSite.Compiler
GreenSite.Compiler.Layout
GreenSite.Compiler.Pandoc
GreenSite.Config
GreenSite.Context
GreenSite.Context.Field
GreenSite.Context.GitCommits
GreenSite.Context.Post
GreenSite.Context.Tag
GreenSite.Lens
GreenSite.Lens.Hakyll
GreenSite.Route
GreenSite.Rule
GreenSite.Rule.Blog
GreenSite.Rule.Feed
GreenSite.Rule.Js
GreenSite.Rule.Page
GreenSite.Rule.Robot
GreenSite.Rule.Sass
GreenSite.Rule.Sitemap
GreenSite.Util
Green
Green.Command
Green.Common
Green.Compiler
Green.Compiler.Layout
Green.Compiler.Pandoc
Green.Config
Green.Context
Green.Context.Field
Green.Context.GitCommits
Green.Context.Post
Green.Context.Tag
Green.Lens
Green.Lens.Hakyll
Green.Route
Green.Rule
Green.Rule.Blog
Green.Rule.Feed
Green.Rule.Js
Green.Rule.Page
Green.Rule.Robot
Green.Rule.Sass
Green.Rule.Sitemap
Green.Util
other-modules:
Paths_green_site
Paths_green
hs-source-dirs:
src
default-extensions:
@ -124,12 +124,12 @@ library
, yaml ==0.11.*
default-language: Haskell2010
executable green
executable author
main-is: Main.hs
other-modules:
Paths_green_site
Paths_green
hs-source-dirs:
app/green
app/author
default-extensions:
BangPatterns
BinaryLiterals
@ -222,7 +222,7 @@ executable green
, containers ==0.6.*
, directory ==1.3.*
, filepath ==1.4.*
, green-site
, green
, hakyll ==4.14.*
, hjsmin ==0.2.*
, language-javascript ==0.7.*
@ -247,7 +247,7 @@ executable green
executable site
main-is: Main.hs
other-modules:
Paths_green_site
Paths_green
hs-source-dirs:
app/site
default-extensions:
@ -342,7 +342,7 @@ executable site
, containers ==0.6.*
, directory ==1.3.*
, filepath ==1.4.*
, green-site
, green
, hakyll ==4.14.*
, hjsmin ==0.2.*
, language-javascript ==0.7.*
@ -368,16 +368,16 @@ test-suite test
type: exitcode-stdio-1.0
main-is: Spec.hs
other-modules:
GreenSite.Compiler.LayoutSpec
GreenSite.RouteSpec
GreenSite.Rule.BlogSpec
GreenSite.TestSupport
GreenSite.TestSupport.Compiler
GreenSite.TestSupport.Config
GreenSite.TestSupport.Resource
GreenSite.TestSupport.Routes
GreenSite.TestSupport.TestEnv
Paths_green_site
Green.Compiler.LayoutSpec
Green.RouteSpec
Green.Rule.BlogSpec
Green.TestSupport
Green.TestSupport.Compiler
Green.TestSupport.Config
Green.TestSupport.Resource
Green.TestSupport.Routes
Green.TestSupport.TestEnv
Paths_green
hs-source-dirs:
test
default-extensions:
@ -472,7 +472,7 @@ test-suite test
, containers ==0.6.*
, directory ==1.3.*
, filepath ==1.4.*
, green-site
, green
, hakyll ==4.14.*
, hjsmin ==0.2.*
, hspec ==2.7.*

10
hie.yaml

@ -1,13 +1,13 @@
cradle:
stack:
- path: "src"
component: "green-site:lib"
component: "green:lib"
- path: "app/green"
component: "green-site:exe:green"
- path: "app/author"
component: "green:exe:author"
- path: "app/site"
component: "green-site:exe:site"
component: "green:exe:site"
- path: "test"
component: "green-site:test:green-site-test"
component: "green:test:green-test"

12
package.yaml

@ -1,4 +1,4 @@
name: green-site
name: green
version: 0.1.0.0
github: ThisFieldWasGreen/thisfieldwasgreen.github.io
license: MIT
@ -111,14 +111,14 @@ executables:
default-extensions: *default-extensions
ghc-options: *ghc-options
dependencies:
- green-site
green:
- green
author:
main: Main.hs
source-dirs: app/green
source-dirs: app/author
default-extensions: *default-extensions
ghc-options: *ghc-options
dependencies:
- green-site
- green
tests:
test:
@ -127,6 +127,6 @@ tests:
default-extensions: *default-extensions
ghc-options: *ghc-options
dependencies:
- green-site
- green
- hspec == 2.7.*
- hspec-core == 2.7.*

20
src/GreenSite.hs → src/Green.hs

@ -1,12 +1,12 @@
module GreenSite where
module Green where
import qualified Data.Text.IO as TIO
import Data.Time
import GreenSite.Command
import GreenSite.Common
import GreenSite.Rule (rules)
import Options.Applicative (execParser)
import System.Environment (getEnvironment, getProgName)
import Green.Command
import Green.Common
import Green.Rule
import Options.Applicative
import System.Environment
site :: IO ()
site = do
@ -20,7 +20,9 @@ site = do
hakyllWith (siteConfig ^. siteHakyllConfiguration) (rules siteConfig)
green :: IO ()
green = do
author :: IO ()
author = do
progName <- getProgName
processGreenCommand =<< execParser (greenCommands progName)
processAuthorCommand =<< customExecParser prefs' (authorCommands progName)
where
prefs' = prefs (showHelpOnError <> showHelpOnEmpty)

43
src/Green/Command.hs

@ -0,0 +1,43 @@
module Green.Command where
import Green.Util
import Options.Applicative
data AuthorCommand
= CreateDraft CreateDraftOpts
| PublishPost FilePath
deriving stock (Show, Eq)
data CreateDraftOpts = CreateDraftOpts
{ draftTitle :: String,
draftCategory :: Maybe String
}
deriving stock (Show, Eq)
authorCommands :: String -> ParserInfo AuthorCommand
authorCommands progName = authorOptions
where
--- commands
authorOptions = info (authorOptions' <**> helper) (fullDesc <> authorDesc)
authorOptions' = subparser draftCommand <|> subparser publishCommand
authorDesc = progDesc (progName ++ " -- an admin tool for the site")
--- draft command
draftCommand = command "draft" $ info draftOptions (progDesc "Create a new draft post")
draftOptions = CreateDraft <$> draftOptions'
draftOptions' = CreateDraftOpts
<$> strOption (long "title" <> short 't')
<*> optional (strOption (long "category" <> short 'c'))
--- publish command
publishCommand = command "publish" $ info publishOptions (progDesc "Publish an existing draft")
publishOptions = PublishPost <$> strOption (long "file" <> short 'f')
processAuthorCommand :: AuthorCommand -> IO ()
processAuthorCommand (CreateDraft draftOpts) = createDraft draftOpts
processAuthorCommand (PublishPost file) = putStrLn ("Publishing " ++ file)
createDraft :: CreateDraftOpts -> IO ()
createDraft (CreateDraftOpts title maybeCategory) =
putStrLn $ "Writing post '" ++ title ++ "' to file " ++ draftFilePath
where
draftFilePath = categoryPrefix ++ kebabCase title ++ ".md"
categoryPrefix = maybe "" ((++ "/") . kebabCase) maybeCategory

42
src/GreenSite/Common.hs → src/Green/Common.hs

@ -1,4 +1,4 @@
module GreenSite.Common
module Green.Common
( module Control.Applicative,
module Control.Exception,
module Control.Monad,
@ -11,16 +11,16 @@ module GreenSite.Common
module Hakyll,
module Lens.Micro,
module Lens.Micro.TH,
module GreenSite.Config,
module GreenSite.Compiler,
module GreenSite.Compiler.Layout,
module GreenSite.Compiler.Pandoc,
module GreenSite.Context.Field,
module GreenSite.Context,
module GreenSite.Lens,
module GreenSite.Lens.Hakyll,
module GreenSite.Route,
module GreenSite.Util,
module Green.Config,
module Green.Compiler,
module Green.Compiler.Layout,
module Green.Compiler.Pandoc,
module Green.Context.Field,
module Green.Context,
module Green.Lens,
module Green.Lens.Hakyll,
module Green.Route,
module Green.Util,
module System.Directory,
module System.FilePath,
)
@ -35,16 +35,16 @@ import Data.Bool (bool)
import Data.Foldable (sequenceA_)
import Data.Functor ((<&>))
import Data.Maybe (fromJust, fromMaybe, isJust, isNothing)
import GreenSite.Compiler
import GreenSite.Compiler.Layout
import GreenSite.Compiler.Pandoc
import GreenSite.Config
import GreenSite.Context
import GreenSite.Context.Field
import GreenSite.Lens
import GreenSite.Lens.Hakyll
import GreenSite.Route
import GreenSite.Util
import Green.Compiler
import Green.Compiler.Layout
import Green.Compiler.Pandoc
import Green.Config
import Green.Context
import Green.Context.Field
import Green.Lens
import Green.Lens.Hakyll
import Green.Route
import Green.Util
import Hakyll
import Lens.Micro hiding ((<&>))
import Lens.Micro.TH

2
src/GreenSite/Compiler.hs → src/Green/Compiler.hs

@ -1,4 +1,4 @@
module GreenSite.Compiler where
module Green.Compiler where
import Control.Monad.Except (catchError)
import Hakyll

4
src/GreenSite/Compiler/Layout.hs → src/Green/Compiler/Layout.hs

@ -1,10 +1,10 @@
module GreenSite.Compiler.Layout where
module Green.Compiler.Layout where
import Control.Monad ((<=<))
import Data.Binary as B
import Data.ByteString.Lazy as LBS
import GHC.Generics hiding (to)
import GreenSite.Config
import Green.Config
import Hakyll
import Lens.Micro
import Lens.Micro.TH

4
src/GreenSite/Compiler/Pandoc.hs → src/Green/Compiler/Pandoc.hs

@ -1,4 +1,4 @@
module GreenSite.Compiler.Pandoc
module Green.Compiler.Pandoc
( compilePandoc,
compilePandocWith,
interpolateItem,
@ -8,7 +8,7 @@ where
import Control.Monad ((>=>))
import Debug.Trace
import GreenSite.Config
import Green.Config
import Hakyll
import Lens.Micro
import Text.Pandoc.Definition

4
src/GreenSite/Config.hs → src/Green/Config.hs

@ -1,4 +1,4 @@
module GreenSite.Config where
module Green.Config where
import Control.Applicative ((<|>))
import Data.Ini.Config
@ -6,7 +6,7 @@ import Data.Maybe (isJust)
import Data.String (IsString)
import Data.Text (Text)
import Data.Time
import GreenSite.Lens.Hakyll
import Green.Lens.Hakyll
import Hakyll
import Hakyll.Core.Configuration as HC
import Lens.Micro

20
src/GreenSite/Context.hs → src/Green/Context.hs

@ -1,17 +1,17 @@
module GreenSite.Context
( module GreenSite.Context.Field,
module GreenSite.Context.GitCommits,
module GreenSite.Context.Post,
module GreenSite.Context.Tag,
module Green.Context
( module Green.Context.Field,
module Green.Context.GitCommits,
module Green.Context.Post,
module Green.Context.Tag,
baseContext,
)
where
import GreenSite.Config
import GreenSite.Context.Field
import GreenSite.Context.GitCommits
import GreenSite.Context.Post
import GreenSite.Context.Tag
import Green.Config
import Green.Context.Field
import Green.Context.GitCommits
import Green.Context.Post
import Green.Context.Tag
import Hakyll (Context, constField)
import Lens.Micro

6
src/GreenSite/Context/Field.hs → src/Green/Context/Field.hs

@ -1,4 +1,4 @@
module GreenSite.Context.Field
module Green.Context.Field
( siteRootField,
includeCodeField,
imgField,
@ -11,8 +11,8 @@ module GreenSite.Context.Field
where
import Control.Monad ((>=>))
import GreenSite.Config (SiteConfig, siteRoot)
import GreenSite.Util
import Green.Config (SiteConfig, siteRoot)
import Green.Util
import Hakyll hiding (demoteHeaders)
import Lens.Micro
import System.FilePath (splitFileName, takeDirectory)

2
src/GreenSite/Context/GitCommits.hs → src/Green/Context/GitCommits.hs

@ -1,4 +1,4 @@
module GreenSite.Context.GitCommits (gitCommits) where
module Green.Context.GitCommits (gitCommits) where
import Data.Bool (bool)
import Data.Maybe (fromJust, isJust)

2
src/GreenSite/Context/Post.hs → src/Green/Context/Post.hs

@ -1,4 +1,4 @@
module GreenSite.Context.Post where
module Green.Context.Post where
import Hakyll

2
src/GreenSite/Context/Tag.hs → src/Green/Context/Tag.hs

@ -1,4 +1,4 @@
module GreenSite.Context.Tag where
module Green.Context.Tag where
import Hakyll

2
src/GreenSite/Lens.hs → src/Green/Lens.hs

@ -1,4 +1,4 @@
module GreenSite.Lens where
module Green.Lens where
import Language.Haskell.TH
import Lens.Micro

4
src/GreenSite/Lens/Hakyll.hs → src/Green/Lens/Hakyll.hs

@ -1,6 +1,6 @@
module GreenSite.Lens.Hakyll where
module Green.Lens.Hakyll where
import GreenSite.Lens
import Green.Lens
import Hakyll
makeLensesWithL ''Configuration

2
src/GreenSite/Route.hs → src/Green/Route.hs

@ -1,4 +1,4 @@
module GreenSite.Route where
module Green.Route where
import Data.List (isSuffixOf)
import Data.String.Utils (join, split)

20
src/GreenSite/Rule.hs → src/Green/Rule.hs

@ -1,14 +1,14 @@
module GreenSite.Rule where
module Green.Rule where
import GreenSite.Compiler.Layout
import GreenSite.Config
import GreenSite.Rule.Blog
import GreenSite.Rule.Feed
import GreenSite.Rule.Js
import GreenSite.Rule.Page
import GreenSite.Rule.Robot
import GreenSite.Rule.Sass
import GreenSite.Rule.Sitemap
import Green.Compiler.Layout
import Green.Config
import Green.Rule.Blog
import Green.Rule.Feed
import Green.Rule.Js
import Green.Rule.Page
import Green.Rule.Robot
import Green.Rule.Sass
import Green.Rule.Sitemap
import Hakyll
rules :: SiteConfig -> Rules ()

4
src/GreenSite/Rule/Blog.hs → src/Green/Rule/Blog.hs

@ -1,6 +1,6 @@
module GreenSite.Rule.Blog where
module Green.Rule.Blog where
import GreenSite.Common
import Green.Common
{-----------------------------------------------------------------------------}
{- Rules -}

6
src/GreenSite/Rule/Feed.hs → src/Green/Rule/Feed.hs

@ -1,7 +1,7 @@
module GreenSite.Rule.Feed (feedRules) where
module Green.Rule.Feed (feedRules) where
import GreenSite.Common
import GreenSite.Rule.Blog (loadPublishedPosts)
import Green.Common
import Green.Rule.Blog (loadPublishedPosts)
feedRules :: SiteConfig -> Rules ()
feedRules config = do

2
src/GreenSite/Rule/Js.hs → src/Green/Rule/Js.hs

@ -1,4 +1,4 @@
module GreenSite.Rule.Js (jsRules) where
module Green.Rule.Js (jsRules) where
import qualified Data.ByteString.Lazy.Char8 as C
import Hakyll

4
src/GreenSite/Rule/Page.hs → src/Green/Rule/Page.hs

@ -1,6 +1,6 @@
module GreenSite.Rule.Page (pageRules) where
module Green.Rule.Page (pageRules) where
import GreenSite.Common
import Green.Common
pageRules :: SiteConfig -> Rules ()
pageRules config = do

4
src/GreenSite/Rule/Robot.hs → src/Green/Rule/Robot.hs

@ -1,6 +1,6 @@
module GreenSite.Rule.Robot where
module Green.Rule.Robot where
import GreenSite.Common
import Green.Common
robotsTxtRules :: SiteConfig -> Rules ()
robotsTxtRules config = do

4
src/GreenSite/Rule/Sass.hs → src/Green/Rule/Sass.hs

@ -1,6 +1,6 @@
module GreenSite.Rule.Sass (sassRules) where
module Green.Rule.Sass (sassRules) where
import GreenSite.Common
import Green.Common
sassRules :: SiteConfig -> Rules ()
sassRules config = do

6
src/GreenSite/Rule/Sitemap.hs → src/Green/Rule/Sitemap.hs

@ -1,7 +1,7 @@
module GreenSite.Rule.Sitemap (sitemapRules) where
module Green.Rule.Sitemap (sitemapRules) where
import GreenSite.Common
import GreenSite.Rule.Blog (loadPublishedPosts)
import Green.Common
import Green.Rule.Blog (loadPublishedPosts)
sitemapRules :: SiteConfig -> Rules ()
sitemapRules config =

2
src/GreenSite/Util.hs → src/Green/Util.hs

@ -1,4 +1,4 @@
module GreenSite.Util where
module Green.Util where
import Data.Char
import Data.Foldable (sequenceA_)

40
src/GreenSite/Command.hs

@ -1,40 +0,0 @@
module GreenSite.Command where
import GreenSite.Util
import Options.Applicative
data GreenCommand
= CreateDraft CreateDraftOpts
| PublishPost FilePath
deriving stock (Show, Eq)
data CreateDraftOpts = CreateDraftOpts
{ draftTitle :: String,
draftCategory :: Maybe String
}
deriving stock (Show, Eq)
greenCommands :: String -> ParserInfo GreenCommand
greenCommands progName = greenOptions
where
--- commands
greenOptions = info (greenOptions' <**> helper) (fullDesc <> greenDesc)
greenOptions' = subparser draftCommand <|> subparser publishCommand
greenDesc = progDesc (progName ++ " -- an admin tool for the site")
--- draft command
draftCommand = command "draft" $ info (draftOptions <**> helper) (progDesc "Create a new draft post")
draftOptions = CreateDraft <$> (CreateDraftOpts <$> strOption (long "title" <> short 't') <*> optional (strOption (long "category" <> short 'c')))
--- publish command
publishCommand = command "publish" $ info (publishOptions <**> helper) (progDesc "Publish an existing draft")
publishOptions = PublishPost <$> strOption (long "file" <> short 'f')
processGreenCommand :: GreenCommand -> IO ()
processGreenCommand (CreateDraft draftOpts) = createDraft draftOpts
processGreenCommand (PublishPost file) = putStrLn ("Publishing " ++ file)
createDraft :: CreateDraftOpts -> IO ()
createDraft (CreateDraftOpts title maybeCategory) =
putStrLn $ "Writing post '" ++ title ++ "' to file " ++ draftFilePath
where
draftFilePath = categoryPrefix ++ kebabCase title ++ ".md"
categoryPrefix = maybe "" ((++ "/") . kebabCase) maybeCategory

6
test/GreenSite/Compiler/LayoutSpec.hs → test/Green/Compiler/LayoutSpec.hs

@ -1,7 +1,7 @@
module GreenSite.Compiler.LayoutSpec where
module Green.Compiler.LayoutSpec where
import GreenSite.Compiler.Layout
import GreenSite.TestSupport
import Green.Compiler.Layout
import Green.TestSupport
spec :: Spec
spec = do

4
test/GreenSite/RouteSpec.hs → test/Green/RouteSpec.hs

@ -1,7 +1,7 @@
module GreenSite.RouteSpec where
module Green.RouteSpec where
import Data.Bifunctor
import GreenSite.TestSupport
import Green.TestSupport
spec :: Spec
spec = do

6
test/GreenSite/Rule/BlogSpec.hs → test/Green/Rule/BlogSpec.hs

@ -1,7 +1,7 @@
module GreenSite.Rule.BlogSpec where
module Green.Rule.BlogSpec where
import GreenSite.Rule.Blog
import GreenSite.TestSupport
import Green.Rule.Blog
import Green.TestSupport
spec :: Spec
spec = do

22
test/Green/TestSupport.hs

@ -0,0 +1,22 @@
module Green.TestSupport
( module Green.Common,
module Green.TestSupport,
module Green.TestSupport.Compiler,
module Green.TestSupport.Config,
module Green.TestSupport.Resource,
module Green.TestSupport.Routes,
module Green.TestSupport.TestEnv,
module Test.Hspec,
)
where
import Green.Common
import Green.TestSupport.Compiler
import Green.TestSupport.Config
import Green.TestSupport.Resource
import Green.TestSupport.Routes
import Green.TestSupport.TestEnv
import Test.Hspec
runAll :: [SpecWith a] -> SpecWith a
runAll = sequenceA_

4
test/GreenSite/TestSupport/Compiler.hs → test/Green/TestSupport/Compiler.hs

@ -1,10 +1,10 @@
module GreenSite.TestSupport.Compiler where
module Green.TestSupport.Compiler where
import Data.Set as S
import Hakyll as H
import Hakyll.Core.Compiler.Internal
import qualified Hakyll.Core.Logger as Logger
import GreenSite.TestSupport.TestEnv
import Green.TestSupport.TestEnv
import Test.Hspec
type RunCompiler a = Compiler a -> Identifier -> IO (CompilerResult a)

4
test/GreenSite/TestSupport/Config.hs → test/Green/TestSupport/Config.hs

@ -1,8 +1,8 @@
module GreenSite.TestSupport.Config where
module Green.TestSupport.Config where
import Data.Time
import Hakyll as H
import GreenSite.Common
import Green.Common
defaultTestTimeString :: String
defaultTestTimeString = "2013-06-16T21:12:00-07:00"

2
test/GreenSite/TestSupport/Resource.hs → test/Green/TestSupport/Resource.hs

@ -1,4 +1,4 @@
module GreenSite.TestSupport.Resource where
module Green.TestSupport.Resource where
-- | Creates a spec resource dependent on a bracketed resource and runs the spec with it
--

6
test/GreenSite/TestSupport/Routes.hs → test/Green/TestSupport/Routes.hs

@ -1,9 +1,9 @@
module GreenSite.TestSupport.Routes where
module Green.TestSupport.Routes where
import Data.Foldable (traverse_)
import Hakyll as H
import GreenSite.Common
import GreenSite.TestSupport.TestEnv
import Green.Common
import Green.TestSupport.TestEnv
import Test.Hspec
type RunRoutes = Routes -> Identifier -> IO (Maybe FilePath, UsedMetadata)

6
test/GreenSite/TestSupport/TestEnv.hs → test/Green/TestSupport/TestEnv.hs

@ -1,11 +1,11 @@
module GreenSite.TestSupport.TestEnv where
module Green.TestSupport.TestEnv where
import Data.Time
import Hakyll as H
import qualified Hakyll.Core.Provider as HP
import qualified Hakyll.Core.Store as HS
import GreenSite.Common
import GreenSite.TestSupport.Config
import Green.Common
import Green.TestSupport.Config
data TestEnv = TestEnv
{ testTime :: ZonedTime,

22
test/GreenSite/TestSupport.hs

@ -1,22 +0,0 @@
module GreenSite.TestSupport
( module GreenSite.Common,
module GreenSite.TestSupport,
module GreenSite.TestSupport.Compiler,
module GreenSite.TestSupport.Config,
module GreenSite.TestSupport.Resource,
module GreenSite.TestSupport.Routes,
module GreenSite.TestSupport.TestEnv,
module Test.Hspec,
)
where
import GreenSite.Common
import GreenSite.TestSupport.Compiler
import GreenSite.TestSupport.Config
import GreenSite.TestSupport.Resource
import GreenSite.TestSupport.Routes
import GreenSite.TestSupport.TestEnv
import Test.Hspec
runAll :: [SpecWith a] -> SpecWith a
runAll = sequenceA_
Loading…
Cancel
Save