summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/Identifier
diff options
context:
space:
mode:
Diffstat (limited to 'src/Hakyll/Core/Identifier')
-rw-r--r--src/Hakyll/Core/Identifier/Pattern.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Hakyll/Core/Identifier/Pattern.hs b/src/Hakyll/Core/Identifier/Pattern.hs
index 8fbc6f8..3a07219 100644
--- a/src/Hakyll/Core/Identifier/Pattern.hs
+++ b/src/Hakyll/Core/Identifier/Pattern.hs
@@ -43,6 +43,7 @@ module Hakyll.Core.Identifier.Pattern
, (.||.)
, complement
, withVersion
+ , noVersion
, fromLiteral
-- * Applying patterns
@@ -228,6 +229,12 @@ withVersion p v = optimize $ And p $ fromVersion $ Just v
--------------------------------------------------------------------------------
+-- | Match only if the identifier has no version set
+noVersion :: Pattern -> Pattern
+noVersion p = optimize $ And p $ fromVersion Nothing
+
+
+--------------------------------------------------------------------------------
-- | Check if a pattern is a literal. @\"*.markdown\"@ is not a literal but
-- @\"posts.markdown\"@ is.
fromLiteral :: Pattern -> Maybe Identifier