diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2011-02-15 22:15:02 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2011-02-15 22:15:02 +0100 |
commit | d00026366c78ef8578f7a9503ced4915b1d4ec28 (patch) | |
tree | 633074bd3e9cf2d961be5b1429ee19d35e68b439 /src/Hakyll/Web/Page | |
parent | 3346123ca661d578ccb458e7135f8b68867bf107 (diff) | |
download | hakyll-d00026366c78ef8578f7a9503ced4915b1d4ec28.tar.gz |
defaultPageRead → defaultPageCompiler
Diffstat (limited to 'src/Hakyll/Web/Page')
-rw-r--r-- | src/Hakyll/Web/Page/Metadata.hs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Hakyll/Web/Page/Metadata.hs b/src/Hakyll/Web/Page/Metadata.hs index 2880ece..23d98a4 100644 --- a/src/Hakyll/Web/Page/Metadata.hs +++ b/src/Hakyll/Web/Page/Metadata.hs @@ -2,6 +2,7 @@ -- module Hakyll.Web.Page.Metadata ( getField + , getFieldMaybe , setField , setFieldA , renderField @@ -31,7 +32,14 @@ import Hakyll.Web.Util.String getField :: String -- ^ Key -> Page a -- ^ Page -> String -- ^ Value -getField key = fromMaybe "" . M.lookup key . pageMetadata +getField key = fromMaybe "" . getFieldMaybe key + +-- | Get a field in a 'Maybe' wrapper +-- +getFieldMaybe :: String -- ^ Key + -> Page a -- ^ Page + -> Maybe String -- ^ Value, if found +getFieldMaybe key = M.lookup key . pageMetadata -- | Add a metadata field. If the field already exists, it is not overwritten. -- |