summaryrefslogtreecommitdiff
path: root/src/Hakyll
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2011-02-15 13:50:10 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2011-02-15 13:50:10 +0100
commitabfb4c19195cf305637f1a9acd7f6dd70d59b831 (patch)
tree0f81662df1b1e19bc2aa4361ead7746a6c64e13e /src/Hakyll
parent878ca8f3b02e99e736edaf5c7f0ba376ff3fe282 (diff)
downloadhakyll-abfb4c19195cf305637f1a9acd7f6dd70d59b831.tar.gz
defaultCompressCss → compressCssCompiler
Diffstat (limited to 'src/Hakyll')
-rw-r--r--src/Hakyll/Web.hs5
-rw-r--r--src/Hakyll/Web/CompressCss.hs12
2 files changed, 11 insertions, 6 deletions
diff --git a/src/Hakyll/Web.hs b/src/Hakyll/Web.hs
index ae86301..74c5c6c 100644
--- a/src/Hakyll/Web.hs
+++ b/src/Hakyll/Web.hs
@@ -6,7 +6,6 @@ module Hakyll.Web
, defaultTemplateReadWith
, defaultRelativizeUrls
, defaultCopyFile
- , defaultCompressCss
, defaultApplyTemplate
) where
@@ -25,7 +24,6 @@ import Hakyll.Web.Pandoc
import Hakyll.Web.Template
import Hakyll.Web.RelativizeUrls
import Hakyll.Web.Util.String
-import Hakyll.Web.CompressCss
defaultPageRead :: Compiler Resource (Page String)
defaultPageRead = cached "Hakyll.Web.defaultPageRead" $
@@ -47,9 +45,6 @@ defaultTemplateReadWith settings = cached "Hakyll.Web.defaultTemplateReadWith" $
defaultCopyFile :: Compiler Resource CopyFile
defaultCopyFile = getIdentifier >>^ CopyFile . toFilePath
-defaultCompressCss :: Compiler Resource String
-defaultCompressCss = getResourceString >>^ compressCss
-
defaultApplyTemplate :: Identifier -- ^ Template
-> Compiler (Page String) (Page String) -- ^ Compiler
defaultApplyTemplate identifier = require identifier (flip applyTemplate)
diff --git a/src/Hakyll/Web/CompressCss.hs b/src/Hakyll/Web/CompressCss.hs
index e138ea2..3e86e09 100644
--- a/src/Hakyll/Web/CompressCss.hs
+++ b/src/Hakyll/Web/CompressCss.hs
@@ -2,14 +2,24 @@
-- state, but would typically reduce the number of bytes by about 25%.
--
module Hakyll.Web.CompressCss
- ( compressCss
+ ( compressCssCompiler
+ , compressCss
) where
import Data.Char (isSpace)
import Data.List (isPrefixOf)
+import Control.Arrow ((>>^))
+import Hakyll.Core.Compiler
+import Hakyll.Core.ResourceProvider
import Hakyll.Web.Util.String
+-- | Compiler form of 'compressCss' which automatically picks the right root
+-- path
+--
+compressCssCompiler :: Compiler Resource String
+compressCssCompiler = getResourceString >>^ compressCss
+
-- | Compress CSS to speed up your site.
--
compressCss :: String -> String