summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/Rules/Default.hs
blob: fee78c52d6641c90ed98f11533c6745c9bf49957 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{-# LANGUAGE OverloadedStrings          #-}
module Hakyll.Core.Rules.Default 
    ( internalRules
    , addMetadataDependencies 
    )
where
import           Hakyll.Core.Rules
import           Hakyll.Core.Compiler
import           Hakyll.Core.Compiler.Internal (compilerTellDependencies)
import           Hakyll.Core.Metadata          (getMatches, metadataFiles)
import           Hakyll.Core.Identifier.Pattern(fromList)

internalRules :: Rules ()
internalRules  = do
    match "metadata" $ compile $ makeItem ()
    match "**/metadata" $ compile $ makeItem ()
    match "**.metadata" $ compile $ makeItem ()

--------------------------------------------------------------------------------
addMetadataDependencies :: Compiler ()
addMetadataDependencies =
    compilerTellDependencies . map IdentifierDependency =<< getMatches . fromList =<< fmap metadataFiles getUnderlying