1module Text.Hakyll.Internal.Cache
6import Control.Monad.Reader (liftIO)
7import Text.Hakyll.Hakyll (Hakyll)
11-- | We can store all datatypes instantiating @Binary@ to the cache. The cache
12-- directory is specified by the @HakyllConfiguration@, usually @_cache@.
13storeInCache :: (Binary a) => a -> FilePath -> Hakyll ()
14storeInCache value path = do
15 cachePath <- toCache path
16 makeDirectories cachePath
17 liftIO $ encodeFile cachePath value
19-- | Get a value from the cache. The filepath given should not be located in the
20-- cache. This function performs a timestamp check on the filepath and the
21-- filepath in the cache, and only returns the cached value when it is still
23getFromCache :: (Binary a) => FilePath -> Hakyll (Maybe a)
25 cachePath <- toCache path
26 valid <- isMoreRecent cachePath [path]
27 if valid then liftIO (decodeFile cachePath) >>= return . Just
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list