summaryrefslogtreecommitdiff
path: root/src/Hakyll/Web.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Hakyll/Web.hs')
-rw-r--r--src/Hakyll/Web.hs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Hakyll/Web.hs b/src/Hakyll/Web.hs
new file mode 100644
index 0000000..bc7710f
--- /dev/null
+++ b/src/Hakyll/Web.hs
@@ -0,0 +1,21 @@
+-- | Module exporting commonly used web-related functions
+--
+module Hakyll.Web
+ ( defaultPageRead
+ , defaultTemplateRead
+ ) where
+
+import Control.Arrow (arr, (>>>), (>>^))
+
+import Hakyll.Core.Compiler
+import Hakyll.Web.Page
+import Hakyll.Web.Pandoc
+import Hakyll.Web.Template
+
+defaultPageRead :: Compiler () (Page String)
+defaultPageRead = cached "Hakyll.Web.defaultPageRead" $
+ pageRead >>> addDefaultFields >>> arr applySelf >>> pageRenderPandoc
+
+defaultTemplateRead :: Compiler () Template
+defaultTemplateRead = cached "Hakyll.Web.defaultTemplateRead" $
+ getResourceString >>^ readTemplate