Commit 0a83209d authored by Fabien Maniere's avatar Fabien Maniere

custom config for hakyll

parent 555a9783
# gargantext.org
Simple website to present GarganText.
---
## Requirements
- install **cabal**
- install **hakyll**:
A Haskell library to manage simple websites (https://jaspervdj.be/hakyll/)
`cabal install hakyll`
## Build and watch
cabal install --overwrite-policy=always #Needed to take account of the custom config in site.hs
site build
site watch
Go to http://localhost:7000
## Hakyll Documentation
Hakyll help and customization: https://robertwpearce.com/hakyll-pt-1-setup-initial-customization.html
Code: https://github.com/jaspervdj/hakyll
\ No newline at end of file
# Ignore files:
_site
_cache
......@@ -6,8 +6,8 @@ import Hakyll
--------------------------------------------------------------------------------
main :: IO ()
main = hakyll $ do
match "images/*" $ do
main = hakyllWith config $ do
match ("js/*" .||. "images/*" .||. "favicon/*" .||. "css/fonts/*") $ do
route idRoute
compile copyFileCompiler
......@@ -15,32 +15,32 @@ main = hakyll $ do
route idRoute
compile compressCssCompiler
match (fromList ["about.rst", "contact.markdown"]) $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
-- match (fromList ["about.rst", "contact.markdown"]) $ do
-- route $ setExtension "html"
-- compile $ pandocCompiler
-- >>= loadAndApplyTemplate "templates/default.html" defaultContext
-- >>= relativizeUrls
match "posts/*" $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/post.html" postCtx
>>= loadAndApplyTemplate "templates/default.html" postCtx
>>= relativizeUrls
-- match "posts/*" $ do
-- route $ setExtension "html"
-- compile $ pandocCompiler
-- >>= loadAndApplyTemplate "templates/post.html" postCtx
-- >>= loadAndApplyTemplate "templates/default.html" postCtx
-- >>= relativizeUrls
create ["archive.html"] $ do
route idRoute
compile $ do
posts <- recentFirst =<< loadAll "posts/*"
let archiveCtx =
listField "posts" postCtx (return posts) `mappend`
constField "title" "Archives" `mappend`
defaultContext
-- create ["archive.html"] $ do
-- route idRoute
-- compile $ do
-- posts <- recentFirst =<< loadAll "posts/*"
-- let archiveCtx =
-- listField "posts" postCtx (return posts) `mappend`
-- constField "title" "Archives" `mappend`
-- defaultContext
makeItem ""
>>= loadAndApplyTemplate "templates/archive.html" archiveCtx
>>= loadAndApplyTemplate "templates/default.html" archiveCtx
>>= relativizeUrls
-- makeItem ""
-- >>= loadAndApplyTemplate "templates/archive.html" archiveCtx
-- >>= loadAndApplyTemplate "templates/default.html" archiveCtx
-- >>= relativizeUrls
match "index.html" $ do
......@@ -64,3 +64,8 @@ postCtx :: Context String
postCtx =
dateField "date" "%B %e, %Y" `mappend`
defaultContext
config :: Configuration
config = defaultConfiguration
{ previewPort = 7000
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment