summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2012-12-29 16:24:27 +0100
committerJasper Van der Jeugt <m@jaspervdj.be>2012-12-29 16:24:27 +0100
commita6cbaff357e2c8f832be8ef76d21ef526430be39 (patch)
tree1ed630264399643c31b2bd0a4969dd1515161718 /src
parent5d4d964fccc53167f25683ff7a0f11cde951ca88 (diff)
downloadhakyll-a6cbaff357e2c8f832be8ef76d21ef526430be39.tar.gz
Link to proper haddock docs on hackage
Diffstat (limited to 'src')
-rw-r--r--src/Hakyll/Core/Compiler.hs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Hakyll/Core/Compiler.hs b/src/Hakyll/Core/Compiler.hs
index 9a8f923..9fec69b 100644
--- a/src/Hakyll/Core/Compiler.hs
+++ b/src/Hakyll/Core/Compiler.hs
@@ -4,6 +4,7 @@
module Hakyll.Core.Compiler
( Compiler
, getUnderlying
+ , getUnderlyingExtension
, makeItem
, getRoute
, getResourceBody
@@ -31,8 +32,8 @@ import Control.Applicative ((<$>))
import Data.Binary (Binary)
import Data.ByteString.Lazy (ByteString)
import Data.Typeable (Typeable)
-import Prelude hiding (id, (.))
import System.Environment (getProgName)
+import System.FilePath (takeExtension)
--------------------------------------------------------------------------------
@@ -53,6 +54,13 @@ getUnderlying = compilerUnderlying <$> compilerAsk
--------------------------------------------------------------------------------
+-- | Get the extension of the underlying identifier. Returns something like
+-- @".html"@
+getUnderlyingExtension :: Compiler String
+getUnderlyingExtension = takeExtension . toFilePath <$> getUnderlying
+
+
+--------------------------------------------------------------------------------
makeItem :: a -> Compiler (Item a)
makeItem x = do
identifier <- getUnderlying