Add bibliography and references management

This commit is contained in:
Dimitri Lozeve 2019-04-03 20:37:53 +02:00
parent 7361faab73
commit beda8aa4d8
3 changed files with 9310 additions and 13 deletions

35
site.hs
View file

@ -23,11 +23,9 @@ main = hakyll $ do
route idRoute
compile compressCssCompiler
match (fromList ["contact.org", "cv.org", "skills.org", "projects.org"]) $ do
route $ setExtension "html"
compile $ customPandocCompiler
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
match "bib/*" $ compile biblioCompiler
match "csl/*" $ compile cslCompiler
match "posts/*" $ do
route $ setExtension "html"
@ -37,6 +35,19 @@ main = hakyll $ do
>>= loadAndApplyTemplate "templates/default.html" postCtx
>>= relativizeUrls
match "projects/*" $ do
route $ setExtension "html"
compile $ customPandocCompiler
>>= loadAndApplyTemplate "templates/project.html" postCtx
>>= loadAndApplyTemplate "templates/default.html" postCtx
>>= relativizeUrls
match (fromList ["contact.org", "cv.org", "skills.org", "projects.org"]) $ do
route $ setExtension "html"
compile $ customPandocCompiler
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
create ["archive.html"] $ do
route idRoute
compile $ do
@ -50,13 +61,6 @@ main = hakyll $ do
>>= loadAndApplyTemplate "templates/default.html" archiveCtx
>>= relativizeUrls
match "projects/*" $ do
route $ setExtension "html"
compile $ customPandocCompiler
>>= loadAndApplyTemplate "templates/project.html" postCtx
>>= loadAndApplyTemplate "templates/default.html" postCtx
>>= relativizeUrls
create ["projects.html"] $ do
route idRoute
compile $ do
@ -121,7 +125,12 @@ customPandocCompiler =
{ writerExtensions = newExtensions
, writerHTMLMathMethod = MathJax ""
}
in pandocCompilerWith defaultHakyllReaderOptions writerOptions
readerOptions = defaultHakyllReaderOptions
in do
csl <- load $ fromFilePath "csl/chicago-author-date.csl"
bib <- load $ fromFilePath "bib/all.bib"
writePandocWith writerOptions <$>
(getResourceBody >>= readPandocBiblio readerOptions csl bib)
type FeedRenderer = FeedConfiguration
-> Context String