diff options
Diffstat (limited to 'src/Hakyll')
-rw-r--r-- | src/Hakyll/Core/Compiler.hs | 11 | ||||
-rw-r--r-- | src/Hakyll/Core/Compiler/Internal.hs | 2 | ||||
-rw-r--r-- | src/Hakyll/Core/Resource.hs | 14 | ||||
-rw-r--r-- | src/Hakyll/Core/Resource/Provider.hs (renamed from src/Hakyll/Core/ResourceProvider.hs) | 13 | ||||
-rw-r--r-- | src/Hakyll/Core/Resource/Provider/File.hs (renamed from src/Hakyll/Core/ResourceProvider/FileResourceProvider.hs) | 5 | ||||
-rw-r--r-- | src/Hakyll/Core/Rules.hs | 3 | ||||
-rw-r--r-- | src/Hakyll/Core/Rules/Internal.hs | 3 | ||||
-rw-r--r-- | src/Hakyll/Core/Run.hs | 5 | ||||
-rw-r--r-- | src/Hakyll/Core/Writable/CopyFile.hs | 2 | ||||
-rw-r--r-- | src/Hakyll/Web/CompressCss.hs | 2 | ||||
-rw-r--r-- | src/Hakyll/Web/Page.hs | 2 | ||||
-rw-r--r-- | src/Hakyll/Web/Template.hs | 2 |
12 files changed, 34 insertions, 30 deletions
diff --git a/src/Hakyll/Core/Compiler.hs b/src/Hakyll/Core/Compiler.hs index 7fe1754..db51131 100644 --- a/src/Hakyll/Core/Compiler.hs +++ b/src/Hakyll/Core/Compiler.hs @@ -89,7 +89,6 @@ module Hakyll.Core.Compiler ( Compiler , runCompiler , getIdentifier - , getIdentifiers , getRoute , getRouteFor , getResourceString @@ -125,7 +124,8 @@ import Hakyll.Core.Identifier import Hakyll.Core.Identifier.Pattern import Hakyll.Core.CompiledItem import Hakyll.Core.Writable -import Hakyll.Core.ResourceProvider +import Hakyll.Core.Resource +import Hakyll.Core.Resource.Provider import Hakyll.Core.Compiler.Internal import Hakyll.Core.Store import Hakyll.Core.Rules.Internal @@ -166,13 +166,6 @@ runCompiler compiler identifier provider routes store modified logger = do getIdentifier :: Compiler a Identifier getIdentifier = fromJob $ const $ CompilerM $ compilerIdentifier <$> ask --- | Get all identifiers matching the given pattern --- -getIdentifiers :: Pattern -> Compiler a [Identifier] -getIdentifiers pattern = fromJob $ const $ CompilerM $ - matches pattern . map unResource . resourceList - . compilerResourceProvider <$> ask - -- | Get the route we are using for this item -- getRoute :: Compiler a (Maybe FilePath) diff --git a/src/Hakyll/Core/Compiler/Internal.hs b/src/Hakyll/Core/Compiler/Internal.hs index 4eef91c..1a3c4c3 100644 --- a/src/Hakyll/Core/Compiler/Internal.hs +++ b/src/Hakyll/Core/Compiler/Internal.hs @@ -26,7 +26,7 @@ import Control.Category (Category, (.), id) import Control.Arrow (Arrow, ArrowChoice, arr, first, left) import Hakyll.Core.Identifier -import Hakyll.Core.ResourceProvider +import Hakyll.Core.Resource.Provider import Hakyll.Core.Store import Hakyll.Core.Routes import Hakyll.Core.Logger diff --git a/src/Hakyll/Core/Resource.hs b/src/Hakyll/Core/Resource.hs new file mode 100644 index 0000000..d60fda9 --- /dev/null +++ b/src/Hakyll/Core/Resource.hs @@ -0,0 +1,14 @@ +-- | Module exporting the simple 'Resource' type +-- +module Hakyll.Core.Resource + ( Resource (..) + ) where + +import Hakyll.Core.Identifier + +-- | A resource +-- +-- Invariant: the resource specified by the given identifier must exist +-- +newtype Resource = Resource {unResource :: Identifier} + deriving (Eq, Show, Ord) diff --git a/src/Hakyll/Core/ResourceProvider.hs b/src/Hakyll/Core/Resource/Provider.hs index dcd4af0..377b029 100644 --- a/src/Hakyll/Core/ResourceProvider.hs +++ b/src/Hakyll/Core/Resource/Provider.hs @@ -10,9 +10,8 @@ -- Therefore, it is not recommended to read files directly -- you should use the -- provided 'Resource' methods. -- -module Hakyll.Core.ResourceProvider - ( Resource (..) - , ResourceProvider (..) +module Hakyll.Core.Resource.Provider + ( ResourceProvider (..) , resourceExists , resourceDigest , resourceModified @@ -27,13 +26,7 @@ import OpenSSL.Digest (MessageDigest (MD5)) import Hakyll.Core.Identifier import Hakyll.Core.Store - --- | A resource --- --- Invariant: the resource specified by the given identifier must exist --- -newtype Resource = Resource {unResource :: Identifier} - deriving (Eq, Show, Ord) +import Hakyll.Core.Resource -- | A value responsible for retrieving and listing resources -- diff --git a/src/Hakyll/Core/ResourceProvider/FileResourceProvider.hs b/src/Hakyll/Core/Resource/Provider/File.hs index 0d89b21..a795fac 100644 --- a/src/Hakyll/Core/ResourceProvider/FileResourceProvider.hs +++ b/src/Hakyll/Core/Resource/Provider/File.hs @@ -1,6 +1,6 @@ -- | A concrete 'ResourceProvider' that gets it's resources from the filesystem -- -module Hakyll.Core.ResourceProvider.FileResourceProvider +module Hakyll.Core.Resource.Provider.File ( fileResourceProvider ) where @@ -8,7 +8,8 @@ import Control.Applicative ((<$>)) import qualified Data.ByteString.Lazy as LB -import Hakyll.Core.ResourceProvider +import Hakyll.Core.Resource +import Hakyll.Core.Resource.Provider import Hakyll.Core.Identifier import Hakyll.Core.Util.File import Hakyll.Core.Configuration diff --git a/src/Hakyll/Core/Rules.hs b/src/Hakyll/Core/Rules.hs index 19df85e..892cf7c 100644 --- a/src/Hakyll/Core/Rules.hs +++ b/src/Hakyll/Core/Rules.hs @@ -37,7 +37,8 @@ import qualified Data.Set as S import Data.Typeable (Typeable) import Data.Binary (Binary) -import Hakyll.Core.ResourceProvider +import Hakyll.Core.Resource +import Hakyll.Core.Resource.Provider import Hakyll.Core.Identifier import Hakyll.Core.Identifier.Pattern import Hakyll.Core.Compiler.Internal diff --git a/src/Hakyll/Core/Rules/Internal.hs b/src/Hakyll/Core/Rules/Internal.hs index 592194d..0e117ec 100644 --- a/src/Hakyll/Core/Rules/Internal.hs +++ b/src/Hakyll/Core/Rules/Internal.hs @@ -18,7 +18,8 @@ import Control.Monad.State (State, evalState) import Data.Monoid (Monoid, mempty, mappend) import Data.Set (Set) -import Hakyll.Core.ResourceProvider +import Hakyll.Core.Resource +import Hakyll.Core.Resource.Provider import Hakyll.Core.Identifier import Hakyll.Core.Identifier.Pattern import Hakyll.Core.Compiler.Internal diff --git a/src/Hakyll/Core/Run.hs b/src/Hakyll/Core/Run.hs index 9a5245d..8e1ba6d 100644 --- a/src/Hakyll/Core/Run.hs +++ b/src/Hakyll/Core/Run.hs @@ -23,8 +23,9 @@ import Hakyll.Core.Identifier import Hakyll.Core.Util.File import Hakyll.Core.Compiler import Hakyll.Core.Compiler.Internal -import Hakyll.Core.ResourceProvider -import Hakyll.Core.ResourceProvider.FileResourceProvider +import Hakyll.Core.Resource +import Hakyll.Core.Resource.Provider +import Hakyll.Core.Resource.Provider.File import Hakyll.Core.Rules.Internal import Hakyll.Core.DirectedGraph import Hakyll.Core.DirectedGraph.DependencySolver diff --git a/src/Hakyll/Core/Writable/CopyFile.hs b/src/Hakyll/Core/Writable/CopyFile.hs index 1cd5fd2..ab9c698 100644 --- a/src/Hakyll/Core/Writable/CopyFile.hs +++ b/src/Hakyll/Core/Writable/CopyFile.hs @@ -12,7 +12,7 @@ import System.Directory (copyFile) import Data.Typeable (Typeable) import Data.Binary (Binary) -import Hakyll.Core.ResourceProvider +import Hakyll.Core.Resource import Hakyll.Core.Writable import Hakyll.Core.Compiler import Hakyll.Core.Identifier diff --git a/src/Hakyll/Web/CompressCss.hs b/src/Hakyll/Web/CompressCss.hs index 2df08fd..090fe10 100644 --- a/src/Hakyll/Web/CompressCss.hs +++ b/src/Hakyll/Web/CompressCss.hs @@ -11,7 +11,7 @@ import Data.List (isPrefixOf) import Control.Arrow ((>>^)) import Hakyll.Core.Compiler -import Hakyll.Core.ResourceProvider +import Hakyll.Core.Resource import Hakyll.Core.Util.String -- | Compiler form of 'compressCss' diff --git a/src/Hakyll/Web/Page.hs b/src/Hakyll/Web/Page.hs index c41647b..5146bdc 100644 --- a/src/Hakyll/Web/Page.hs +++ b/src/Hakyll/Web/Page.hs @@ -67,7 +67,7 @@ import Data.Ord (comparing) import Hakyll.Core.Identifier import Hakyll.Core.Compiler -import Hakyll.Core.ResourceProvider +import Hakyll.Core.Resource import Hakyll.Web.Page.Internal import Hakyll.Web.Page.Read import Hakyll.Web.Page.Metadata diff --git a/src/Hakyll/Web/Template.hs b/src/Hakyll/Web/Template.hs index 9c49278..33e7a9b 100644 --- a/src/Hakyll/Web/Template.hs +++ b/src/Hakyll/Web/Template.hs @@ -59,7 +59,7 @@ import Text.Hamlet (HamletSettings, defaultHamletSettings) import Hakyll.Core.Compiler import Hakyll.Core.Identifier -import Hakyll.Core.ResourceProvider +import Hakyll.Core.Resource import Hakyll.Web.Template.Internal import Hakyll.Web.Template.Read import Hakyll.Web.Page.Internal |