summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/Rules
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2013-04-04 11:47:50 +0200
committerJasper Van der Jeugt <m@jaspervdj.be>2013-04-04 11:47:50 +0200
commitcf9838150801dc71d68cd3a4ca0631946d749256 (patch)
tree8e28cebffefa3bfbf8de3630fb057e61fd8e1955 /src/Hakyll/Core/Rules
parent030a5fe4bd749798509830bc0eae8cfb87941e7e (diff)
downloadhakyll-cf9838150801dc71d68cd3a4ca0631946d749256.tar.gz
Add event filtering based on pattern
Diffstat (limited to 'src/Hakyll/Core/Rules')
-rw-r--r--src/Hakyll/Core/Rules/Internal.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Hakyll/Core/Rules/Internal.hs b/src/Hakyll/Core/Rules/Internal.hs
index 6bb82df..a7c2059 100644
--- a/src/Hakyll/Core/Rules/Internal.hs
+++ b/src/Hakyll/Core/Rules/Internal.hs
@@ -47,14 +47,17 @@ data RuleSet = RuleSet
rulesCompilers :: [(Identifier, Compiler SomeItem)]
, -- | A set of the actually used files
rulesResources :: Set Identifier
+ , -- | A pattern we can use to check if a file *would* be used. This is
+ -- needed for the preview server.
+ rulesPattern :: Pattern
}
--------------------------------------------------------------------------------
instance Monoid RuleSet where
- mempty = RuleSet mempty mempty mempty
- mappend (RuleSet r1 c1 s1) (RuleSet r2 c2 s2) =
- RuleSet (mappend r1 r2) (mappend c1 c2) (mappend s1 s2)
+ mempty = RuleSet mempty mempty mempty mempty
+ mappend (RuleSet r1 c1 s1 p1) (RuleSet r2 c2 s2 p2) =
+ RuleSet (mappend r1 r2) (mappend c1 c2) (mappend s1 s2) (p1 .||. p2)
--------------------------------------------------------------------------------