From 0fd0b322a504d31c54153fdefc7588ce0d4953b5 Mon Sep 17 00:00:00 2001 From: Chris Wells Date: Thu, 27 Feb 2025 10:49:54 -0600 Subject: Adding pages --- app/Main.hs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'app/Main.hs') diff --git a/app/Main.hs b/app/Main.hs index f739cae..1e935e8 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -4,6 +4,7 @@ import Prolog import Hakyll import Hakyll.Alias +import Hakyll.Util import Data.Alias (AliasMap) import Data.Name (Name_) import Data.Person (Person_) @@ -12,7 +13,7 @@ import Data.License (License_) import Hakyll.Aeson (yamlCompiler) import Hakyll.TeX.BibTeX (bibtexCompiler) import WWW.Base (baseHakyll, domain) -import WWW.Templates (myContext) +import WWW.Templates (myContext, defaultTemplate) @@ -20,9 +21,9 @@ main :: IO () main = baseHakyll domain $ do match "templates/**" $ compile templateCompiler match "data/*.bib" $ compile bibtexCompiler - -- match "data/people.yaml" $ compile $ yamlCompiler @(AliasMap Name_ Person_) - -- match "data/licenses.yaml" $ compile $ yamlCompiler @(AliasMap StrictText License_) - -- match "data/journals.yaml" $ compile $ yamlCompiler @(AliasMap StrictText Journal_) + match "data/people.yaml" $ compile $ yamlCompiler @(AliasMap Name_ Person_) + match "data/licenses.yaml" $ compile $ yamlCompiler @(AliasMap StrictText License_) + match "data/journals.yaml" $ compile $ yamlCompiler @(AliasMap StrictText Journal_) let baseCtxt :: Compiler (Context String) baseCtxt = fold <$> sequence [ pure myContext @@ -30,4 +31,15 @@ main = baseHakyll domain $ do , licenseCtxt @StrictText <$> loadBody "data/licenses.yaml" , journalCtxt @StrictText <$> loadBody "data/journals.yaml" ] + match "www/research/index.html" $ do + route $ dropParentRoute 1 + compile $ do + papers <- undefined + match "www/teaching/index.md" $ do + route $ dropParentRoute 1 `composeRoutes` setExtension ".html" + compile $ myPandocCompiler >>= applyTemplate defaultTemplate baseCtxt pure () + + +myPandocCompiler :: Compiler (Item String) +myPandocCompiler = pandocCompilerWith myHakyllReaderOptions myHakyllWriterOptions -- cgit v1.2.3