Browse Source

Had to rename Site module to GreenSite because it clashes with 'site' executable name on case-insensitive file systems, creating hard separation between drafts and published posts

image-sizing
Logan McGrath 11 months ago
parent
commit
8fafc0db60
  1. 2
      app/green/Main.hs
  2. 2
      app/site/Main.hs
  3. 5
      commands.sh
  4. 204
      green-site.cabal
  5. 17
      hie.yaml
  6. 19
      package.yaml
  7. 2
      site/_drafts/lessons-from-sterling.md
  8. 0
      site/_drafts/morphisms-are-lossy.md
  9. 2
      site/_drafts/sterling-benchmarks.md
  10. 2
      site/_drafts/sterling-with-memoization.md
  11. 2
      site/_posts/2012-11-07-using-perforce-chronicle-for-application-configuration.md
  12. 2
      site/_posts/2012-11-16-scm-backed-application-configuration-with-perforce.md
  13. 2
      site/_posts/2012-11-20-app-config-app-in-action.md
  14. 2
      site/_posts/2012-11-28-promoting-changes-with-app-config-app.md
  15. 6
      src/GreenSite.hs
  16. 42
      src/GreenSite/Common.hs
  17. 2
      src/GreenSite/Compiler.hs
  18. 4
      src/GreenSite/Compiler/Layout.hs
  19. 4
      src/GreenSite/Compiler/Pandoc.hs
  20. 4
      src/GreenSite/Config.hs
  21. 20
      src/GreenSite/Context.hs
  22. 6
      src/GreenSite/Context/Field.hs
  23. 2
      src/GreenSite/Context/GitCommits.hs
  24. 2
      src/GreenSite/Context/Post.hs
  25. 2
      src/GreenSite/Context/Tag.hs
  26. 2
      src/GreenSite/Lens.hs
  27. 4
      src/GreenSite/Lens/Hakyll.hs
  28. 2
      src/GreenSite/Route.hs
  29. 20
      src/GreenSite/Rule.hs
  30. 4
      src/GreenSite/Rule/Blog.hs
  31. 6
      src/GreenSite/Rule/Feed.hs
  32. 2
      src/GreenSite/Rule/Js.hs
  33. 4
      src/GreenSite/Rule/Page.hs
  34. 4
      src/GreenSite/Rule/Robot.hs
  35. 4
      src/GreenSite/Rule/Sass.hs
  36. 6
      src/GreenSite/Rule/Sitemap.hs
  37. 2
      src/GreenSite/Util.hs
  38. 6
      test/GreenSite/Compiler/LayoutSpec.hs
  39. 4
      test/GreenSite/RouteSpec.hs
  40. 6
      test/GreenSite/Rule/BlogSpec.hs
  41. 22
      test/GreenSite/TestSupport.hs
  42. 4
      test/GreenSite/TestSupport/Compiler.hs
  43. 4
      test/GreenSite/TestSupport/Config.hs
  44. 2
      test/GreenSite/TestSupport/Resource.hs
  45. 6
      test/GreenSite/TestSupport/Routes.hs
  46. 6
      test/GreenSite/TestSupport/TestEnv.hs
  47. 22
      test/Site/TestSupport.hs

2
app/green/Main.hs

@ -0,0 +1,2 @@
main :: IO ()
main = putStrLn "work in progress"

2
app/Main.hs → app/site/Main.hs

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

5
commands.sh

@ -24,7 +24,7 @@ build () {
fi
stack build
stack exec logans-site-exe build
stack exec site build
}
clean () {
@ -55,7 +55,7 @@ rebuild_all () {
watch () {
build
stack exec logans-site-exe watch
stack exec site watch
}
publish () {
@ -102,4 +102,3 @@ test_sync () {
test () {
stack test
}

204
logans-site.cabal → green-site.cabal

@ -3,10 +3,8 @@ cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.34.4.
--
-- see: https://github.com/sol/hpack
--
-- hash: c2a201f0e9fb8f7a66fd23f2bda9bb18fd1a782745ae9d442bf692a7702ceb21
name: logans-site
name: green-site
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
@ -25,31 +23,31 @@ source-repository head
library
exposed-modules:
Site
Site.Common
Site.Compiler
Site.Compiler.Layout
Site.Compiler.Pandoc
Site.Config
Site.Context
Site.Context.Field
Site.Context.GitCommits
Site.Context.Post
Site.Context.Tag
Site.Lens
Site.Lens.Hakyll
Site.Route
Site.Rule
Site.Rule.Blog
Site.Rule.Feed
Site.Rule.Js
Site.Rule.Page
Site.Rule.Robot
Site.Rule.Sass
Site.Rule.Sitemap
Site.Util
GreenSite
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
other-modules:
Paths_logans_site
Paths_green_site
hs-source-dirs:
src
default-extensions:
@ -125,12 +123,132 @@ library
, yaml ==0.11.*
default-language: Haskell2010
executable logans-site-exe
executable green
main-is: Main.hs
other-modules:
Paths_green_site
hs-source-dirs:
app/green
default-extensions:
BangPatterns
BinaryLiterals
BlockArguments
ConstraintKinds
DataKinds
DefaultSignatures
DeriveDataTypeable
DeriveFoldable
DeriveFunctor
DeriveGeneric
DeriveTraversable
DerivingStrategies
DoAndIfThenElse
EmptyDataDecls
ExistentialQuantification
FlexibleContexts
FlexibleInstances
FunctionalDependencies
GADTs
GeneralizedNewtypeDeriving
InstanceSigs
KindSignatures
LambdaCase
MultiParamTypeClasses
MultiWayIf
NamedFieldPuns
OverloadedStrings
PartialTypeSignatures
PatternGuards
PatternSynonyms
PolyKinds
RankNTypes
RecordWildCards
ScopedTypeVariables
StandaloneDeriving
TemplateHaskell
TupleSections
TypeFamilies
TypeSynonymInstances
ViewPatterns
BangPatterns
BinaryLiterals
BlockArguments
ConstraintKinds
DataKinds
DefaultSignatures
DeriveDataTypeable
DeriveFoldable
DeriveFunctor
DeriveGeneric
DeriveTraversable
DerivingStrategies
DoAndIfThenElse
EmptyDataDecls
ExistentialQuantification
FlexibleContexts
FlexibleInstances
FunctionalDependencies
GADTs
GeneralizedNewtypeDeriving
InstanceSigs
KindSignatures
LambdaCase
MultiParamTypeClasses
MultiWayIf
NamedFieldPuns
OverloadedStrings
PartialTypeSignatures
PatternGuards
PatternSynonyms
PolyKinds
RankNTypes
RecordWildCards
ScopedTypeVariables
StandaloneDeriving
TemplateHaskell
TupleSections
TypeFamilies
TypeSynonymInstances
ViewPatterns
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Werror -Wcompat -Widentities -Wincomplete-patterns -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-deriving-strategies -Wmissing-home-modules -Wname-shadowing -Wpartial-fields -Wredundant-constraints -Wunused-type-patterns -threaded -rtsopts -with-rtsopts=-N -Wall -Werror -Wcompat -Widentities -Wincomplete-patterns -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-deriving-strategies -Wmissing-home-modules -Wname-shadowing -Wpartial-fields -Wredundant-constraints -Wunused-type-patterns
build-depends:
MissingH ==1.4.*
, aeson ==1.5.*
, base >=4.7 && <5
, binary ==0.8.*
, bytestring ==0.*
, config-ini ==0.2.*
, containers ==0.6.*
, directory ==1.3.*
, filepath ==1.4.*
, green-site
, hakyll ==4.14.*
, hjsmin ==0.2.*
, language-javascript ==0.7.*
, microlens ==0.4.*
, microlens-th ==0.4.*
, mtl ==2.2.*
, optparse-applicative >=0.12 && <0.17
, pandoc ==2.11.*
, pandoc-types ==1.22.*
, process ==1.6.*
, tagsoup ==0.14.*
, template-haskell ==2.16.*
, text ==1.2.*
, time ==1.9.*
, transformers ==0.5.*
, unordered-containers ==0.2.*
, utf8-string ==1.0.*
, vector ==0.12.*
, yaml ==0.11.*
default-language: Haskell2010
executable site
main-is: Main.hs
other-modules:
Paths_logans_site
Paths_green_site
hs-source-dirs:
app
app/site
default-extensions:
BangPatterns
BinaryLiterals
@ -223,10 +341,10 @@ executable logans-site-exe
, containers ==0.6.*
, directory ==1.3.*
, filepath ==1.4.*
, green-site
, hakyll ==4.14.*
, hjsmin ==0.2.*
, language-javascript ==0.7.*
, logans-site
, microlens ==0.4.*
, microlens-th ==0.4.*
, mtl ==2.2.*
@ -245,20 +363,20 @@ executable logans-site-exe
, yaml ==0.11.*
default-language: Haskell2010
test-suite logans-site-test
test-suite test
type: exitcode-stdio-1.0
main-is: Spec.hs
other-modules:
Site.Compiler.LayoutSpec
Site.RouteSpec
Site.Rule.BlogSpec
Site.TestSupport
Site.TestSupport.Compiler
Site.TestSupport.Config
Site.TestSupport.Resource
Site.TestSupport.Routes
Site.TestSupport.TestEnv
Paths_logans_site
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
hs-source-dirs:
test
default-extensions:
@ -353,12 +471,12 @@ test-suite logans-site-test
, containers ==0.6.*
, directory ==1.3.*
, filepath ==1.4.*
, green-site
, hakyll ==4.14.*
, hjsmin ==0.2.*
, hspec ==2.7.*
, hspec-core ==2.7.*
, language-javascript ==0.7.*
, logans-site
, microlens ==0.4.*
, microlens-th ==0.4.*
, mtl ==2.2.*

17
hie.yaml

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

19
package.yaml

@ -1,4 +1,4 @@
name: logans-site
name: green-site
version: 0.1.0.0
github: ThisFieldWasGreen/thisfieldwasgreen.github.io
license: MIT
@ -105,21 +105,28 @@ ghc-options: &ghc-options
- -Wunused-type-patterns
executables:
logans-site-exe:
site:
main: Main.hs
source-dirs: app
source-dirs: app/site
default-extensions: *default-extensions
ghc-options: *ghc-options
dependencies:
- logans-site
- green-site
green:
main: Main.hs
source-dirs: app/green
default-extensions: *default-extensions
ghc-options: *ghc-options
dependencies:
- green-site
tests:
logans-site-test:
test:
main: Spec.hs
source-dirs: test
default-extensions: *default-extensions
ghc-options: *ghc-options
dependencies:
- logans-site
- green-site
- hspec == 2.7.*
- hspec-core == 2.7.*

2
site/_posts/2013-08-05-lessons-from-sterling.md → site/_drafts/lessons-from-sterling.md

@ -2,7 +2,7 @@
layout: post
title: "Lessons from Sterling"
author: "Logan McGrath"
created: 2013-08-05T09:37:00-07:00
date: 2013-08-05T09:37:00-07:00
comments: false
tags: Sterling, Functional Programming, Language Design
---

0
site/_posts/morphisms-are-lossy.md → site/_drafts/morphisms-are-lossy.md

2
site/_posts/2013-06-16-sterling-benchmarks.md → site/_drafts/sterling-benchmarks.md

@ -1,7 +1,7 @@
---
layout: post
title: "Sterling Benchmarks"
created: 2013-06-16T21:12:00-07:00
date: 2013-06-16T21:12:00-07:00
comments: false
tags: Functional Programming, Sterling, Language Design
---

2
site/_posts/2013-06-17-sterling-with-memoization.md → site/_drafts/sterling-with-memoization.md

@ -2,7 +2,7 @@
layout: post
title: "Sterling With Memoization"
author: "Logan McGrath"
created: 2013-06-17T04:26:00-07:00
date: 2013-06-17T04:26:00-07:00
comments: false
tags: Sterling, Functional Programming, Language Design
---

2
site/_posts/2012-11-07-using-perforce-chronicle-for-application-configuration.md

@ -2,7 +2,7 @@
layout: post
title: "Using Perforce Chronicle for application configuration"
author: "Logan McGrath"
created: 2012-11-07T13:54:00-05:00
date: 2012-11-07T13:54:00-05:00
published: 2012-11-07T13:54:00-05:00
tags: Perforce, Configuration Management
---

2
site/_posts/2012-11-16-scm-backed-application-configuration-with-perforce.md

@ -2,7 +2,7 @@
layout: post
title: "SCM-Backed Application Configuration with Perforce"
author: "Logan McGrath"
created: 2012-11-16T07:00:00-05:00
date: 2012-11-16T07:00:00-05:00
published: 2012-11-16T07:00:00-05:00
comments: false
tags: SCM, Perforce, Sinatra, AngularJS

2
site/_posts/2012-11-20-app-config-app-in-action.md

@ -2,7 +2,7 @@
layout: post
title: "App-Config-App in Action"
author: "Logan McGrath"
created: 2012-11-20T07:00:00-05:00
date: 2012-11-20T07:00:00-05:00
published: 2012-11-20T07:00:00-05:00
comments: false
tags: AngularJS, Perforce, SCM, Sinatra, Configuration Management

2
site/_posts/2012-11-28-promoting-changes-with-app-config-app.md

@ -2,7 +2,7 @@
layout: post
title: "Promoting changes with App-Config-App"
author: "Logan McGrath"
created: 2012-11-28T13:04:00-05:00
date: 2012-11-28T13:04:00-05:00
published: 2012-11-28T13:04:00-05:00
comments: false
tags: AngularJS, Perforce, SCM, Sinatra, Configuration Management

6
src/Site.hs → src/GreenSite.hs

@ -1,9 +1,9 @@
module Site where
module GreenSite where
import qualified Data.Text.IO as TIO
import Data.Time
import Site.Common
import Site.Rule (rules)
import GreenSite.Common
import GreenSite.Rule (rules)
import System.Environment (getEnvironment)
site :: IO ()

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

@ -1,4 +1,4 @@
module Site.Common
module GreenSite.Common
( module Control.Applicative,
module Control.Exception,
module Control.Monad,
@ -11,16 +11,16 @@ module Site.Common
module Hakyll,
module Lens.Micro,
module Lens.Micro.TH,
module Site.Config,
module Site.Compiler,
module Site.Compiler.Layout,
module Site.Compiler.Pandoc,
module Site.Context.Field,
module Site.Context,
module Site.Lens,
module Site.Lens.Hakyll,
module Site.Route,
module Site.Util,
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 System.Directory,
module System.FilePath,
)
@ -35,18 +35,18 @@ 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 Hakyll
import Lens.Micro hiding ((<&>))
import Lens.Micro.TH
import Site.Compiler
import Site.Compiler.Layout
import Site.Compiler.Pandoc
import Site.Config
import Site.Context
import Site.Context.Field
import Site.Lens
import Site.Lens.Hakyll
import Site.Route
import Site.Util
import System.Directory (copyFile, createDirectoryIfMissing, doesFileExist)
import System.FilePath (takeDirectory, (</>))

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

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

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

@ -1,13 +1,13 @@
module Site.Compiler.Layout where
module GreenSite.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 Hakyll
import Lens.Micro
import Lens.Micro.TH
import Site.Config
data Layout = Layout
{ _layoutStack :: [Item Template],

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

@ -1,4 +1,4 @@
module Site.Compiler.Pandoc
module GreenSite.Compiler.Pandoc
( compilePandoc,
compilePandocWith,
interpolateItem,
@ -8,9 +8,9 @@ where
import Control.Monad ((>=>))
import Debug.Trace
import GreenSite.Config
import Hakyll
import Lens.Micro
import Site.Config
import Text.Pandoc.Definition
import Text.Pandoc.Highlighting (pygments)
import qualified Text.Pandoc.Options as Opt

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

@ -1,4 +1,4 @@
module Site.Config where
module GreenSite.Config where
import Control.Applicative ((<|>))
import Data.Ini.Config
@ -6,11 +6,11 @@ import Data.Maybe (isJust)
import Data.String (IsString)
import Data.Text (Text)
import Data.Time
import GreenSite.Lens.Hakyll
import Hakyll
import Hakyll.Core.Configuration as HC
import Lens.Micro
import Lens.Micro.TH
import Site.Lens.Hakyll
import System.FilePath
data SiteConfig = SiteConfig

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

@ -1,19 +1,19 @@
module Site.Context
( module Site.Context.Field,
module Site.Context.GitCommits,
module Site.Context.Post,
module Site.Context.Tag,
module GreenSite.Context
( module GreenSite.Context.Field,
module GreenSite.Context.GitCommits,
module GreenSite.Context.Post,
module GreenSite.Context.Tag,
baseContext,
)
where
import GreenSite.Config
import GreenSite.Context.Field
import GreenSite.Context.GitCommits
import GreenSite.Context.Post
import GreenSite.Context.Tag
import Hakyll (Context, constField)
import Lens.Micro
import Site.Config
import Site.Context.Field
import Site.Context.GitCommits
import Site.Context.Post
import Site.Context.Tag
baseContext :: SiteConfig -> Context String -> Context String
baseContext config defaultContext =

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

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

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

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

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

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

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

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

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

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

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

@ -1,7 +1,7 @@
module Site.Lens.Hakyll where
module GreenSite.Lens.Hakyll where
import GreenSite.Lens
import Hakyll
import Site.Lens
makeLensesWithL ''Configuration
makeLensesWithL ''FeedConfiguration

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

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

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

@ -1,15 +1,15 @@
module Site.Rule where
module GreenSite.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 Hakyll
import Site.Compiler.Layout
import Site.Config
import Site.Rule.Blog
import Site.Rule.Feed
import Site.Rule.Js
import Site.Rule.Page
import Site.Rule.Robot
import Site.Rule.Sass
import Site.Rule.Sitemap
rules :: SiteConfig -> Rules ()
rules config = do

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -1,4 +1,4 @@
module Site.Util where
module GreenSite.Util where
import Data.Char (digitToInt, intToDigit, isDigit)
import Data.Foldable (sequenceA_)

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

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

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

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

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

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

22
test/GreenSite/TestSupport.hs

@ -0,0 +1,22 @@
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_

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

@ -1,10 +1,10 @@
module Site.TestSupport.Compiler where
module GreenSite.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 Site.TestSupport.TestEnv
import GreenSite.TestSupport.TestEnv
import Test.Hspec
type RunCompiler a = Compiler a -> Identifier -> IO (CompilerResult a)

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

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

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

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

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

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

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

@ -1,11 +1,11 @@
module Site.TestSupport.TestEnv where
module GreenSite.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 Site.Common
import Site.TestSupport.Config
import GreenSite.Common
import GreenSite.TestSupport.Config
data TestEnv = TestEnv
{ testTime :: ZonedTime,

22
test/Site/TestSupport.hs

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