This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "snap-static-pages".
The branch, master has been updated
via 501aeb3680dc5b063e3d38287c2d30f037681d2c (commit)
via f615e8cab8b4a2233ee032372925f22120000ef5 (commit)
from 7d1953c85182671e8526beb11824845bafbe89f0 (commit)
Summary of changes:
snap-static-pages.cabal | 4 ++--
src/Snap/StaticPages.hs | 13 +++++++++----
2 files changed, 11 insertions(+), 6 deletions(-)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 501aeb3680dc5b063e3d38287c2d30f037681d2c
Merge: f615e8c 7d1953c
Author: Mighty Byte <[email protected]>
Date: Sun Dec 12 10:11:58 2010 -0500
Merge branch 'master' of git.snapframework.com:snap-static-pages
Conflicts:
snap-static-pages.cabal
diff --cc snap-static-pages.cabal
index a6aec4e,2357540..c2ca0c9
--- a/snap-static-pages.cabal
+++ b/snap-static-pages.cabal
@@@ -29,8 -29,8 +29,8 @@@ Librar
directory,
feed,
filepath,
- heist >= 0.2.4 && <0.4,
+ heist >= 0.4 && <0.5,
- hexpat >= 0.19 && <0.20,
+ hexpat >= 0.19.5 && <0.20,
monads-fd >= 0.1 && <0.2,
mtl,
old-locale,
commit f615e8cab8b4a2233ee032372925f22120000ef5
Author: Mighty Byte <[email protected]>
Date: Sun Dec 12 10:07:59 2010 -0500
Upgraded to work with the newest Heist.
diff --git a/snap-static-pages.cabal b/snap-static-pages.cabal
index f1a0c63..a6aec4e 100644
--- a/snap-static-pages.cabal
+++ b/snap-static-pages.cabal
@@ -1,5 +1,5 @@
Name: snap-static-pages
-Version: 0.0.1
+Version: 0.1
Synopsis: A simple filesystem-based content management system for
Snap
Author: Gregory Collins
@@ -29,7 +29,7 @@ Library
directory,
feed,
filepath,
- heist >= 0.2.4 && <0.4,
+ heist >= 0.4 && <0.5,
hexpat >= 0.19 && <0.20,
monads-fd >= 0.1 && <0.2,
mtl,
diff --git a/src/Snap/StaticPages.hs b/src/Snap/StaticPages.hs
index 1b03d38..a09b5f8 100644
--- a/src/Snap/StaticPages.hs
+++ b/src/Snap/StaticPages.hs
@@ -16,6 +16,7 @@ module Snap.StaticPages
, StaticPagesException
, staticPagesExceptionMsg
, StaticPagesState
+ , staticPagesTemplateDir
)
where
@@ -71,20 +72,20 @@ reloadStaticPages' ts mv = modifyMVar_ mv $ \st -> do
-}
initStaticPages :: FilePath -- ^ path to staticPages directory
-> IO StaticPagesState
-initStaticPages = initStaticPages' emptyTemplateState
+initStaticPages pth = initStaticPages' (emptyTemplateState pth) pth
initStaticPages' :: TemplateState Snap -- ^ root template state
-> FilePath -- ^ path to staticPages directory
-> IO StaticPagesState
initStaticPages' ts pth = do
-- make sure directories exist
- mapM_ failIfNotDir [pth, contentDir, templateDir]
+ mapM_ failIfNotDir [pth, contentDir, staticPagesTemplateDir pth]
(feed, siteURL, baseURL, excludeList) <- readConfig configFilePath
cmap <- buildContentMap baseURL contentDir
- etemplates <- loadTemplates templateDir ts
+ etemplates <- loadTemplates (staticPagesTemplateDir pth) ts
templates <- either (\s -> throwIO $
StaticPagesException $
@@ -117,10 +118,14 @@ initStaticPages' ts pth = do
--------------------------------------------------------------------------
configFilePath = pth </> "config"
contentDir = pth </> "content"
- templateDir = pth </> "templates"
------------------------------------------------------------------------------
+-- | Takes the static pages root directory and returns the template directory
+-- for static pages. If you construct your own 'TemplateState', use this to
+-- construct the parameter to emptyTemplateState.
+staticPagesTemplateDir :: FilePath -> FilePath
+staticPagesTemplateDir pth = pth </> "templates"
getM :: Cfg.Get_C a => Cfg.ConfigParser -> String -> String -> Maybe a
getM cp section = either (const Nothing) Just . Cfg.get cp section
-----------------------------------------------------------------------
hooks/post-receive
--
snap-static-pages
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap