summaryrefslogtreecommitdiff
path: root/src/Site/Content.hs
diff options
context:
space:
mode:
authorCarlos Sosa <gnusosa@gnusosa.net>2019-08-24 20:47:26 -0700
committerCarlos Sosa <gnusosa@gnusosa.net>2019-08-24 20:47:26 -0700
commitec3a4a4715700294206d6e78d8b38a57a7de7592 (patch)
tree82f7bf9cd081332216efb7f4e2eed77240f2c845 /src/Site/Content.hs
parent03a8fc8f75a1bf0f5afb7d0dd11cd7e881a7d763 (diff)
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]]
Diffstat (limited to 'src/Site/Content.hs')
-rw-r--r--src/Site/Content.hs32
1 files changed, 32 insertions, 0 deletions
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