summaryrefslogtreecommitdiff
path: root/src/Hakyll/Web.hs
blob: bc7710fb3d2a885cfbf6017907dd2a9bbebc681d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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