Skip to content
Snippets Groups Projects
Verified Commit 6f2727af authored by orestis.malaspin's avatar orestis.malaspin
Browse files

hopefully this works now

parent dfac0e11
No related branches found
No related tags found
No related merge requests found
Pipeline #15665 failed
...@@ -56,6 +56,7 @@ main = hakyllWith config $ do ...@@ -56,6 +56,7 @@ main = hakyllWith config $ do
.||. "cours/prog_seq/slides/figs/*" .||. "cours/prog_seq/slides/figs/*"
-- .||. "cours/algo/slides/figs/*" -- .||. "cours/algo/slides/figs/*"
.||. "cours/math_tech_info/figs/*" .||. "cours/math_tech_info/figs/*"
-- .||. "cours/algo/slides/*.json"
.||. "cours/algo/slides/*.pdf" .||. "cours/algo/slides/*.pdf"
.||. "cours/math_tech_info/cours.pdf" .||. "cours/math_tech_info/cours.pdf"
.||. "cours/isc_physics/cours.pdf" .||. "cours/isc_physics/cours.pdf"
...@@ -128,20 +129,26 @@ main = hakyllWith config $ do ...@@ -128,20 +129,26 @@ main = hakyllWith config $ do
>>= relativizeUrls >>= relativizeUrls
-- -- Algorithmique slides -- Algorithmique slides
-- match "cours/algo/slides/*.markdown" $ do -- match "cours/algo/slides/*.markdown" $ do
-- route $ setExtension "html" -- route $ setExtension "html"
-- compile $ pandocRevealCompiler -- compile $ pandocRevealCompiler
-- >>= loadAndApplyTemplate "templates/reveal.html" postCtx -- >>= loadAndApplyTemplate "templates/reveal.html" postCtx
-- >>= relativizeUrls -- >>= relativizeUrls
match "cours/algo/slides/index.md" $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/post.html" postCtx
>>= relativizeUrls
-- Prog seq post list -- Prog seq post list
create ["cours/algo.html"] $ do create ["cours/algo.html"] $ do
route idRoute route idRoute
compile $ do compile $ do
posts <- recentFirst =<< loadAll "cours/algo/slides/index.md" posts <- recentFirst =<< loadAll "cours/algo/slides/index.md"
makeItem "" makeItem ""
>>= loadAndApplyTemplate "templates/archive.html" (pagesCtx posts "Algorithmique et structure de données") >>= loadAndApplyTemplate "templates/archive.html" (courseCtx posts "Les slides d'Algorithmique en PDF" "algo/slides/index.html")
>>= relativizeUrls >>= relativizeUrls
-- Team description -- Team description
...@@ -219,6 +226,7 @@ main = hakyllWith config $ do ...@@ -219,6 +226,7 @@ main = hakyllWith config $ do
where where
staticPages = staticPages =
[ "pages/contact.md" [ "pages/contact.md"
-- , "cours/algo/slides/index.md"
] ]
-- Used to compile to PDF -- Used to compile to PDF
...@@ -247,6 +255,11 @@ mathCtx = field "mathjax" $ \item -> do ...@@ -247,6 +255,11 @@ mathCtx = field "mathjax" $ \item -> do
then "<script type=\"text/javascript\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML\"></script>" then "<script type=\"text/javascript\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML\"></script>"
else "" else ""
noPostCtx title pdfurl =
constField "title" title
`mappend` constField "pdfurl" pdfurl
`mappend` defaultContext
courseCtx posts title pdfurl = courseCtx posts title pdfurl =
listField "posts" postCtx (return posts) listField "posts" postCtx (return posts)
`mappend` constField "title" title `mappend` constField "title" title
...@@ -358,17 +371,17 @@ config :: Configuration ...@@ -358,17 +371,17 @@ config :: Configuration
config = defaultConfiguration config = defaultConfiguration
{ {
deploySite = deploy deploySite = deploy
-- , ignoreFile = ignoreFile' -- , ignoreFile = ignoreFile'
} }
where where
-- ignoreFile' path -- ignoreFile' path
-- | "." `isPrefixOf` fileName = False -- | "." `isPrefixOf` fileName = False
-- | "#" `isPrefixOf` fileName = True -- | "#" `isPrefixOf` fileName = True
-- | "~" `isSuffixOf` fileName = True -- | "~" `isSuffixOf` fileName = True
-- | ".swp" `isSuffixOf` fileName = True -- | ".swp" `isSuffixOf` fileName = True
-- | otherwise = False -- | otherwise = False
-- where -- where
-- fileName = takeFileName path -- fileName = takeFileName path
deploy :: Configuration -> IO ExitCode deploy :: Configuration -> IO ExitCode
deploy _c = do deploy _c = do
Process.rawSystem "rsync" Process.rawSystem "rsync"
......
...@@ -11,6 +11,8 @@ build: update Main.hs cours/math_tech_info/*.md cours/isc_physics/*.md ...@@ -11,6 +11,8 @@ build: update Main.hs cours/math_tech_info/*.md cours/isc_physics/*.md
make -C cours/isc_physics make -C cours/isc_physics
make markdown -C cours/prog_seq/slides make markdown -C cours/prog_seq/slides
# make markdown -C cours/algo/slides # make markdown -C cours/algo/slides
make puppeteer -C cours/algo/slides
make -C cours/algo/slides
make index -C cours/algo/slides make index -C cours/algo/slides
stack build --allow-different-user && stack exec --allow-different-user blog -- build stack build --allow-different-user && stack exec --allow-different-user blog -- build
# cabal install && blog build # cabal install && blog build
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>$title$</title>
<link href="/css/bootstrap.css" rel="stylesheet">
<link href="/css/syntax.css" rel="stylesheet">
<link href="/css/carousel.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<style>
body {
font-family: 'Open Sans', sans-serif;
}
body { margin-top: 80px; }
footer { margin-top: 80px; }
</style>
</head>
<body>
$partial("templates/nav.html")$
<div class="container">
<h1>$title$</h1>
$if(pdfurl)$
<h3><a href="$pdfurl$">Le polycopié en entier [pdf]</a></h3>
$endif$
<h2>Les chapitres</h2>
$partial("templates/footer.html")$
</div>
</div><!-- /.container -->
<script src="/js/jquery.js"></script>
<script src="/js/bootstrap.js"></script>
<script src="/js/holder.js"></script>
</body>
</html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment