From b560adefbc71801fd4c6ce54bd09c775517857e8 Mon Sep 17 00:00:00 2001 From: Justin Hsu Date: Thu, 18 Feb 2016 23:48:24 -0500 Subject: [PATCH] Remove redundant bib titles. Put titles in templates, not in source code. --- site.hs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/site.hs b/site.hs index e2d907c..474d0af 100644 --- a/site.hs +++ b/site.hs @@ -13,11 +13,10 @@ config = defaultConfiguration { deployCommand = "echo `pwd`; ./scripts/deploy.sh" } -------------------------------------------------------------------------------- -bibHeaders :: [(String, String, [String])] -bibHeaders = [ ("confs", "Conference Publications", - ["-c", "$type='INPROCEEDINGS'" ] ) - , ("draft", "Drafts" , - [ "-c", "$type='UNPUBLISHED'" ] ) +bibHeaders :: [(String, [String])] +bibHeaders = [ ("draft" , [ "-c", "$type='UNPUBLISHED'" ] ) , + ("confs" , [ "-c", "$type='INPROCEEDINGS'" ] ) , + ("journal", [ "-c", "$type='ARTICLE'" ] ) ] bibSources :: [String] @@ -71,7 +70,7 @@ main = hakyllWith config $ do route $ setExtension "css" compile $ compass - forM_ bibHeaders $ \(nick, title, flags) -> + forM_ bibHeaders $ \(nick, flags) -> create [fromCapture "bibs/*.html" nick] $ do route idRoute compile $ @@ -85,9 +84,7 @@ main = hakyllWith config $ do (\(i:_) _ -> return $ "files/posters/" ++ i ++ "poster.pdf") ] biblioCtx = mconcat - [ field "bibtitle" (\_ -> return $ title) - , field "bibitems" $ return . itemBody - ] in do + [ field "bibitems" $ return . itemBody ] in do bibTpl <- loadBody "templates/bibitemtpl.html" (bib2bib flags) >>= bib2bibParse @@ -99,7 +96,7 @@ main = hakyllWith config $ do match "content/biblio.md" $ do route $ setExtension "html" compile $ do - let makeBibCtx (nick, _, _) = + let makeBibCtx (nick, _) = field nick (\_ -> loadBody $ fromFilePath ("bibs/" ++ nick ++ ".html")) secDiv = defaultHakyllWriterOptions { writerSectionDivs = True } biblioCtx = mconcat $ map makeBibCtx bibHeaders in do