Remove redundant bib titles.

Put titles in templates, not in source code.
This commit is contained in:
Justin Hsu 2016-02-18 23:48:24 -05:00
parent 93241045b4
commit b560adefbc
1 changed files with 7 additions and 10 deletions

17
site.hs
View File

@ -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