diff --git a/app/site.hs b/app/site.hs index 51e15a7..324a903 100644 --- a/app/site.hs +++ b/app/site.hs @@ -15,7 +15,7 @@ config = defaultConfiguration -------------------------------------------------------------------------------- bibHeaders :: [(String, [String])] -bibHeaders = [ ("draft" , [ "-c", "$type='UNPUBLISHED'" ] ) , +bibHeaders = [ ("drafts" , [ "-c", "$type='UNPUBLISHED'" ] ) , ("thesis" , [ "-c", "$type='PHDTHESIS'" ] ) , ("pubs" , [ "-c", "$type='INPROCEEDINGS' or $type='ARTICLE'" ] ) ] @@ -70,31 +70,6 @@ main = hakyllWith config $ do route $ setExtension "css" compile $ compass - forM_ bibHeaders $ \(nick, flags) -> - create [fromCapture (fromGlob "bibs/*.html") nick] $ do - route idRoute - compile $ - let biblioCtx = mconcat - [ field "bibitems" $ return . itemBody ] in do - bibTpl <- loadBody $ fromFilePath "templates/bibitemtpl.html" - (bib2bib flags) - >>= bib2bibParse - >>= applyTemplateList bibTpl bibEntryContext - >>= makeItem - >>= loadAndApplyTemplate (fromFilePath "templates/biblisttpl.html") biblioCtx - >>= relativizeUrls - - match (fromGlob "content/biblio.md") $ do - route $ setExtension "html" - compile $ do - let makeBibCtx (nick, _) = - field nick (\_ -> loadBody $ fromFilePath ("bibs/" ++ nick ++ ".html")) - secDiv = defaultHakyllWriterOptions { writerSectionDivs = True } - biblioCtx = mconcat $ map makeBibCtx bibHeaders in do - pandocCompilerWith defaultHakyllReaderOptions secDiv - >>= applyAsTemplate biblioCtx - >>= relativizeUrls - match (fromGlob "content/*.md") $ do route $ setExtension "html" compile $ do @@ -107,14 +82,27 @@ main = hakyllWith config $ do compile $ do let loadSec sec = field sec (\_ -> loadBody (fromFilePath $ "content/" ++ sec ++ ".md")) - mainContext = mconcat $ fmap loadSec contentSections - indexContext = - field "footer" (\_ -> loadBody $ fromFilePath "content/footer.md") - `mappend` - defaultContext + makeBibCtx (nick, _) = + field nick (\_ -> loadBody $ fromFilePath ("bibs/" ++ nick ++ ".html")) + biblioContext = mconcat $ map makeBibCtx bibHeaders + indexContext = mconcat $ fmap loadSec contentSections + footerContext = field "footer" (\_ -> loadBody $ fromFilePath "content/footer.md") getResourceBody - >>= applyAsTemplate mainContext - >>= loadAndApplyTemplate (fromFilePath "templates/main.html") indexContext + >>= applyAsTemplate (indexContext <> biblioContext <> footerContext <> defaultContext) >>= relativizeUrls + forM_ bibHeaders $ \(nick, flags) -> + create [fromCapture (fromGlob "bibs/*.html") nick] $ do + route idRoute + compile $ + let biblioCtx = mconcat + [ field "bibitems" $ return . itemBody ] in do + bibTpl <- loadBody $ fromFilePath "templates/bibitem.html" + (bib2bib flags) + >>= bib2bibParse + >>= applyTemplateList bibTpl bibEntryContext + >>= makeItem + >>= applyAsTemplate biblioCtx + >>= relativizeUrls + match (fromGlob "templates/*") $ compile templateCompiler diff --git a/content/biblio.md b/content/biblio.md deleted file mode 100644 index 78c4864..0000000 --- a/content/biblio.md +++ /dev/null @@ -1,11 +0,0 @@ -## Drafts ## - -\$draft\$ - -## Thesis ## - -\$thesis\$ - -## Refereed Publications ## - -\$pubs\$ diff --git a/content/body.md b/content/body.md deleted file mode 100644 index f1b15ac..0000000 --- a/content/body.md +++ /dev/null @@ -1,13 +0,0 @@ -# About Me # {#card} -... - -# Research Interests # {#card} -... - -# Publications # {#card} - -\$draft\$ - -\$confs\$ - -\$journal\$ diff --git a/css/style.scss b/css/style.scss index 1972333..fda2c46 100644 --- a/css/style.scss +++ b/css/style.scss @@ -192,7 +192,7 @@ body { }; } -#drafts, #thesis, #refereed-publications { +#drafts, #thesis, #pubs { padding: $text-pad; } diff --git a/index.html b/index.html index 2fdf3bf..6891273 100644 --- a/index.html +++ b/index.html @@ -1,33 +1,99 @@ -
-
-
- + + + + + + + + Justin Hsu + + + + + + + + + +
+
+

Justin Hsu

+
+ +
+
+
+ +
+ +
+ $contacts$ +
-
- $contacts$ +
+
+ About Me +
+ + $about$
-
+
+
+ News +
+ $news$ +
+ +
- About Me + Bibliography
- - $about$ +
+

Drafts

+ + $drafts$ +
+

+
+

Thesis

+ + $thesis$ +
+

+
+

Refereed Publications

+ + $pubs$ +
+

-
-
- News -
- $news$ -
- -
-
- Bibliography -
- $biblio$ -
+
+ + $footer$ + +
+ + diff --git a/templates/bibitemtpl.html b/templates/bibitem.html similarity index 100% rename from templates/bibitemtpl.html rename to templates/bibitem.html diff --git a/templates/biblisttpl.html b/templates/biblisttpl.html deleted file mode 100644 index ca842bd..0000000 --- a/templates/biblisttpl.html +++ /dev/null @@ -1,3 +0,0 @@ - -$bibitems$ -
diff --git a/templates/main.html b/templates/main.html deleted file mode 100644 index 694f9a7..0000000 --- a/templates/main.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - Justin Hsu - - - - - - - - - -
-
-

Justin Hsu

-
- - $body$ - -
- - -