From 97497393c6917d4b05c495ad59345ce827d896b9 Mon Sep 17 00:00:00 2001 From: Orestis <orestis.malaspinas@hesge.ch> Date: Thu, 5 Nov 2020 07:26:45 +0100 Subject: [PATCH] updated --- .gitmodules | 3 ++ hakyll-bootstrap/Main.hs | 39 +++++++++++++++++++++++++ hakyll-bootstrap/cours/prog_seq | 1 + hakyll-bootstrap/hakyll-bootstrap.cabal | 4 +-- hakyll-bootstrap/stack.yaml | 15 ++++++++-- 5 files changed, 57 insertions(+), 5 deletions(-) create mode 160000 hakyll-bootstrap/cours/prog_seq diff --git a/.gitmodules b/.gitmodules index 4ae0889..59efd2b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "hakyll-bootstrap/cours/isc_physics"] path = hakyll-bootstrap/cours/isc_physics url = https://gitedu.hesge.ch/orestis.malaspin/isc_physics.git +[submodule "hakyll-bootstrap/cours/prog_seq"] + path = hakyll-bootstrap/cours/prog_seq + url = https://gitedu.hesge.ch/programmation_sequentielle/cours.git diff --git a/hakyll-bootstrap/Main.hs b/hakyll-bootstrap/Main.hs index 6c05654..e10ac74 100644 --- a/hakyll-bootstrap/Main.hs +++ b/hakyll-bootstrap/Main.hs @@ -134,6 +134,25 @@ bachelor = do >>= loadAndApplyTemplate "templates/archive.html" (bachelorCtx posts) >>= relativizeUrls +cours_prog_seq :: Rules () +cours_prog_seq = do + match "cours/prog_seq/*.md" $ do + route $ setExtension "html" + -- compile $ myPandocCompiler + compile $ revealCompiler + >>= loadAndApplyTemplate "templates/class.html" postCtx + >>= relativizeUrls + +prog_seq :: Rules () +prog_seq = do + create ["prog_seq.html"] $ do + route idRoute + compile $ do + posts <- recentFirst =<< loadAll "cours/prod_seq/*" + makeItem "" + >>= loadAndApplyTemplate "templates/archive.html" (courseCtx posts "Programmation séquentielle") + >>= relativizeUrls + cours_conc :: Rules () cours_conc = do match "cours/*" $ do @@ -259,6 +278,24 @@ bibtexCompiler = do >>= readPandocWith defaultHakyllReaderOptions >>= return . writePandocWith pandocOptions +revealCompiler :: Compiler (Item String) +revealCompiler = do + getResourceBody + >>= withItemBody (unixFilter "pandoc" ["-F" + , "pandoc-numbering" + , "-F" + , "pandoc-crossref" + , "-t" + , "revealjs" + , "--self-contained" + , "--metadata" + , "title=metadata.yaml" + , "-V" + , "theme=white" + ]) + >>= readPandocWith defaultHakyllReaderOptions + >>= return . writePandocWith pandocOptions + cfg :: Configuration cfg = defaultConfiguration @@ -269,6 +306,8 @@ main = hakyllWith cfg $ do posts cours_conc conc + cours_prog_seq + prog_seq cours_mti mti cours_phys_app diff --git a/hakyll-bootstrap/cours/prog_seq b/hakyll-bootstrap/cours/prog_seq new file mode 160000 index 0000000..f8f4b6c --- /dev/null +++ b/hakyll-bootstrap/cours/prog_seq @@ -0,0 +1 @@ +Subproject commit f8f4b6ca9aef830cab7b0d1e87273ea823460e75 diff --git a/hakyll-bootstrap/hakyll-bootstrap.cabal b/hakyll-bootstrap/hakyll-bootstrap.cabal index 0389b75..5b33fc8 100644 --- a/hakyll-bootstrap/hakyll-bootstrap.cabal +++ b/hakyll-bootstrap/hakyll-bootstrap.cabal @@ -14,9 +14,9 @@ executable blog build-depends: base , containers - , pandoc + , pandoc , pandoc-crossref - , hakyll + , hakyll , hakyll-images , process , text diff --git a/hakyll-bootstrap/stack.yaml b/hakyll-bootstrap/stack.yaml index 2a9b203..32d237c 100644 --- a/hakyll-bootstrap/stack.yaml +++ b/hakyll-bootstrap/stack.yaml @@ -17,7 +17,7 @@ # # resolver: ./custom-snapshot.yaml # resolver: https://example.com/snapshots/2018-01-01.yaml -resolver: nightly-2020-04-18 +resolver: lts-16.20 # User packages to be built. # Various formats can be used as shown in the example below. @@ -40,13 +40,22 @@ packages: # commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a # extra-deps: - - pandoc-crossref-0.3.6.2 + - hakyll-4.13.4.1 + - pandoc-crossref-0.3.8.0 - data-accessor-template-0.2.1.16 - roman-numerals-0.5.1.5 - hakyll-images-0.4.4 - process-1.6.8.0 - text-1.2.4.0 - filepath-1.4.2.1 + - 'commonmark-0.1.0.2' + - 'commonmark-extensions-0.2.0.1' + - 'commonmark-pandoc-0.2.0.1' + - 'hslua-1.1.2' + - 'jira-wiki-markup-1.3.2' + - 'pandoc-2.10.1' + - 'pandoc-types-1.21' + - Cabal-3.2.1.0 # Override default flag values for local packages and extra-deps # flags: {} @@ -70,4 +79,4 @@ extra-deps: # # Allow a newer minor version of GHC than the snapshot specifies # compiler-check: newer-minor -allow-newer: true +# allow-newer: true -- GitLab