From ec3a4a4715700294206d6e78d8b38a57a7de7592 Mon Sep 17 00:00:00 2001 From: Carlos Sosa Date: Sat, 24 Aug 2019 20:47:26 -0700 Subject: Move to use src/ directory with the addition of Site modules - Added Content record with Lenses. - Added Rules based content compilers * This is all based on [[https://github.com/blaenk/blaenk.github.io/blob/source/src/Site/Compilers.hs]] --- src/Site/Content.hs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/Site/Content.hs (limited to 'src/Site/Content.hs') diff --git a/src/Site/Content.hs b/src/Site/Content.hs new file mode 100644 index 0000000..2f82484 --- /dev/null +++ b/src/Site/Content.hs @@ -0,0 +1,32 @@ +{-# LANGUAGE TemplateHaskell #-} +module Site.Content + ( Content(..) + , contentPattern + , contentPaths + , contentRoute + , contentContext + , contentTemplate + , contentIndexContext + , contentIndexTemplate + ) +where + +import Control.Lens +import Hakyll ( Pattern + , Context + , Routes + , Identifier + ) + +-- the information for a kind of content, e.g. notes +data Content = Content { + _contentPattern :: Pattern + , _contentPaths :: [Identifier] + , _contentRoute :: Routes + , _contentContext :: Hakyll.Context String + , _contentTemplate :: String + , _contentIndexContext :: Hakyll.Context String + , _contentIndexTemplate :: String + } + +makeLenses ''Content -- cgit v1.3-2-g0d8e