diff options
| author | Chris Wells <chris@mathematicaster.org> | 2025-02-11 14:47:40 -0600 |
|---|---|---|
| committer | Chris Wells <chris@mathematicaster.org> | 2025-02-11 14:47:40 -0600 |
| commit | e914e77f87a51c25141ab297d11344118a6f6e20 (patch) | |
| tree | 0aef8b8da0a6ad630834d77a838657b839d791f0 /app/Main.hs | |
| parent | 0c677070edf9978cb85a0b521f7e6e0ef6d6b491 (diff) | |
| download | main-e914e77f87a51c25141ab297d11344118a6f6e20.tar main-e914e77f87a51c25141ab297d11344118a6f6e20.tar.gz main-e914e77f87a51c25141ab297d11344118a6f6e20.tar.bz2 main-e914e77f87a51c25141ab297d11344118a6f6e20.tar.lz main-e914e77f87a51c25141ab297d11344118a6f6e20.tar.xz main-e914e77f87a51c25141ab297d11344118a6f6e20.tar.zst main-e914e77f87a51c25141ab297d11344118a6f6e20.zip | |
Working on aliases
Diffstat (limited to 'app/Main.hs')
| -rw-r--r-- | app/Main.hs | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/app/Main.hs b/app/Main.hs index 632651e..f739cae 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -2,8 +2,32 @@ module Main where import Prolog import Hakyll + +import Hakyll.Alias +import Data.Alias (AliasMap) +import Data.Name (Name_) +import Data.Person (Person_) +import Data.Journal (Journal_) +import Data.License (License_) +import Hakyll.Aeson (yamlCompiler) +import Hakyll.TeX.BibTeX (bibtexCompiler) import WWW.Base (baseHakyll, domain) +import WWW.Templates (myContext) + + main :: IO () main = baseHakyll domain $ do - undefined + 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_) + let baseCtxt :: Compiler (Context String) + baseCtxt = fold <$> sequence + [ pure myContext + , personCtxt @StrictText <$> loadBody "data/people.yaml" + , licenseCtxt @StrictText <$> loadBody "data/licenses.yaml" + , journalCtxt @StrictText <$> loadBody "data/journals.yaml" + ] + pure () |
