summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/Resource
diff options
context:
space:
mode:
Diffstat (limited to 'src/Hakyll/Core/Resource')
-rw-r--r--src/Hakyll/Core/Resource/Provider/File.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Hakyll/Core/Resource/Provider/File.hs b/src/Hakyll/Core/Resource/Provider/File.hs
index b2172b8..3a67817 100644
--- a/src/Hakyll/Core/Resource/Provider/File.hs
+++ b/src/Hakyll/Core/Resource/Provider/File.hs
@@ -1,5 +1,6 @@
-- | A concrete 'ResourceProvider' that gets it's resources from the filesystem
--
+{-# LANGUAGE CPP #-}
module Hakyll.Core.Resource.Provider.File
( fileResourceProvider
) where
@@ -29,6 +30,10 @@ fileResourceProvider configuration = do
(mtime . unResource)
where
mtime r = do
+#if MIN_VERSION_directory(1,2,0)
+ getModificationTime r
+#else
ct <- toCalendarTime =<< getModificationTime r
let str = formatCalendarTime defaultTimeLocale "%s" ct
return $ readTime defaultTimeLocale "%s" str
+#endif