diff options
| author | Chris Wells <chris@mathematicaster.org> | 2026-01-21 08:12:03 -0600 |
|---|---|---|
| committer | Chris Wells <chris@mathematicaster.org> | 2026-01-21 08:12:03 -0600 |
| commit | 0c2ae07a2952c4041d960e1dee9ebfd8c594d597 (patch) | |
| tree | 0729c69d5058349af62a00392dfee31d82c1d612 /app/Main.hs | |
| parent | 5d83e36ef8210d1514259c89ff97a25c4d19600c (diff) | |
| download | main-0c2ae07a2952c4041d960e1dee9ebfd8c594d597.tar main-0c2ae07a2952c4041d960e1dee9ebfd8c594d597.tar.gz main-0c2ae07a2952c4041d960e1dee9ebfd8c594d597.tar.bz2 main-0c2ae07a2952c4041d960e1dee9ebfd8c594d597.tar.lz main-0c2ae07a2952c4041d960e1dee9ebfd8c594d597.tar.xz main-0c2ae07a2952c4041d960e1dee9ebfd8c594d597.tar.zst main-0c2ae07a2952c4041d960e1dee9ebfd8c594d597.zip | |
Moved in css and js
Diffstat (limited to 'app/Main.hs')
| -rw-r--r-- | app/Main.hs | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/app/Main.hs b/app/Main.hs index 9c375a1..155688e 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -3,6 +3,7 @@ module Main where import Prolog import Hakyll import Data.List qualified as L +import Data.Ord (Down (..)) import Hakyll.Alias import Hakyll.Util @@ -15,6 +16,8 @@ import Data.Paper (Paper (..)) import Hakyll.Aeson (yamlCompiler) import Hakyll.Paper (papersCompiler, mkPaperContext, FieldContext (..)) import Hakyll.TeX.BibTeX (bibtexCompiler) +import Hakyll.Web.Sass +import Text.Jasmine import WWW.Base (baseHakyll, domain, myHakyllWriterOptions, myHakyllReaderOptions) import WWW.Templates (myContext, defaultTemplate) @@ -28,6 +31,18 @@ main = baseHakyll domain $ do 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 ("www/css/*.scss" .||. "css/*.sass") $ do + route $ dropParentRoute 1 `composeRoutes` setExtension "css" + compile $ compressCss <<$>> sassCompiler + match "www/css/*css" $ do + route $ dropParentRoute 1 + compile compressCssCompiler + match "www/js/*.js" $ do + route $ dropParentRoute 1 + compile $ minify <<$>> getResourceLBS + + let baseCtxt :: Context String baseCtxt = fold $ [ myContext @@ -46,7 +61,7 @@ main = baseHakyll domain $ do route $ dropParentRoute 1 compile $ do papers <- loadBody @[Paper String] "data/papers.bib" - let fixedPapers = L.reverse $ L.sort $ papers <&> \p -> p + let fixedPapers = L.sortOn Down $ papers <&> \p -> p { authors = (`filter` authors p) $ flip notElem [ Name "Cox" "Christopher" Nothing , Name "Wells" "Chris" Nothing @@ -57,6 +72,22 @@ main = baseHakyll domain $ do route $ dropParentRoute 1 `composeRoutes` setExtension ".html" -- compile $ myPandocCompiler >>= applyAsTemplate baseCtxt >>= applyTemplate defaultTemplate baseCtxt compile $ getResourceBody >>= applyAsTemplate baseCtxt >>= myRenderPandoc >>= applyTemplate defaultTemplate baseCtxt + + match "www/links/index.md" $ do + route $ dropParentRoute 1 `composeRoutes` setExtension ".html" + compile $ getResourceBody >>= applyAsTemplate baseCtxt >>= myRenderPandoc >>= applyTemplate defaultTemplate baseCtxt + + match "www/contact/*.html" $ do + route $ dropParentRoute 1 + compile $ getResourceBody >>= applyAsTemplate baseCtxt >>= applyTemplate defaultTemplate baseCtxt + + match "www/code/*.html" $ do + route $ dropParentRoute 1 + compile $ getResourceBody >>= applyAsTemplate baseCtxt >>= applyTemplate defaultTemplate baseCtxt + + match "www/credits/*.html" $ do + route $ dropParentRoute 1 + compile $ myPandocCompiler >>= applyTemplate defaultTemplate baseCtxt pure () |
