diff --git a/hakyll-bootstrap/Main.hs b/hakyll-bootstrap/Main.hs index 9ceefff14b6715da67aebe1303bf4d15f7a6bd24..b0334f762bf3aa7b0b9540e4fbdffb47f3697e7b 100644 --- a/hakyll-bootstrap/Main.hs +++ b/hakyll-bootstrap/Main.hs @@ -73,7 +73,7 @@ main = hakyllWith config $ do >>= relativizeUrls -- Phys app post list - create ["phys_app.html"] $ do + create ["cours/phys_app.html"] $ do route idRoute compile $ do posts <- recentFirst =<< loadAll ("cours/isc_physics/*.markdown" .&&. hasNoVersion) @@ -99,7 +99,7 @@ main = hakyllWith config $ do -- >>= xelatex -- Math Tech Info post list - create ["math_tech_info.html"] $ do + create ["cours/math_tech_info.html"] $ do route idRoute compile $ do posts <- recentFirst =<< loadAll ("cours/math_tech_info/*.markdown" .&&. hasNoVersion) @@ -115,7 +115,7 @@ main = hakyllWith config $ do >>= relativizeUrls -- Phys app post list - create ["prog_seq.html"] $ do + create ["cours/prog_seq.html"] $ do route idRoute compile $ do posts <- recentFirst =<< loadAll "cours/prog_seq/slides/*.markdown" @@ -129,13 +129,43 @@ main = hakyllWith config $ do compile $ pandocCompiler >>= relativizeUrls - -- Phys app post list - create ["team.html"] $ do + -- Team members list + create ["pages/team.html"] $ do route idRoute compile $ do posts <- recentFirst =<< loadAll "team/*.md" makeItem "" - >>= loadAndApplyTemplate "templates/team.html" (courseRevealCtx posts "Research group") + >>= loadAndApplyTemplate "templates/team.html" (pagesCtx posts "Research group") + >>= relativizeUrls + + -- Research description + match "posts/research/*.md" $ do + route $ setExtension "html" + compile $ pandocCompiler + >>= relativizeUrls + + -- Research topics + create ["pages/research_projects.html"] $ do + route idRoute + compile $ do + posts <- recentFirst =<< loadAll "posts/research/*.md" + makeItem "" + >>= loadAndApplyTemplate "templates/archive.html" (pagesCtx posts "Research projects") + >>= relativizeUrls + + -- Team description + match "posts/bachelor/*.md" $ do + route $ setExtension "html" + compile $ pandocCompiler + >>= relativizeUrls + + -- Team members list + create ["pages/bachelor_projects.html"] $ do + route idRoute + compile $ do + posts <- recentFirst =<< loadAll "posts/bachelor/*.md" + makeItem "" + >>= loadAndApplyTemplate "templates/archive.html" (pagesCtx posts "Bachelor projects") >>= relativizeUrls -- Index @@ -255,21 +285,11 @@ courseCtx posts title pdfurl = `mappend` constField "pdfurl" pdfurl `mappend` defaultContext -courseRevealCtx posts title = +pagesCtx posts title = listField "posts" postCtx (return posts) `mappend` constField "title" title `mappend` defaultContext -researchCtx posts = - listField "posts" postCtx (return posts) - `mappend` constField "title" "Research projects" - `mappend` defaultContext - -bachelorCtx posts = - listField "posts" postCtx (return posts) - `mappend` constField "title" "Bachelor projects" - `mappend` defaultContext - indexCtx posts = listField "posts" postCtx (return posts) `mappend` constField "title" "Home" diff --git a/hakyll-bootstrap/pages/about.html b/hakyll-bootstrap/old.pages/about.html similarity index 100% rename from hakyll-bootstrap/pages/about.html rename to hakyll-bootstrap/old.pages/about.html diff --git a/hakyll-bootstrap/pages/contact.html b/hakyll-bootstrap/old.pages/contact.html similarity index 100% rename from hakyll-bootstrap/pages/contact.html rename to hakyll-bootstrap/old.pages/contact.html diff --git a/hakyll-bootstrap/pages/privacy.html b/hakyll-bootstrap/old.pages/privacy.html similarity index 100% rename from hakyll-bootstrap/pages/privacy.html rename to hakyll-bootstrap/old.pages/privacy.html diff --git a/hakyll-bootstrap/pages/signup.html b/hakyll-bootstrap/old.pages/signup.html similarity index 100% rename from hakyll-bootstrap/pages/signup.html rename to hakyll-bootstrap/old.pages/signup.html diff --git a/hakyll-bootstrap/pages/team.html b/hakyll-bootstrap/old.pages/team.html similarity index 100% rename from hakyll-bootstrap/pages/team.html rename to hakyll-bootstrap/old.pages/team.html diff --git a/hakyll-bootstrap/pages/tos.html b/hakyll-bootstrap/old.pages/tos.html similarity index 100% rename from hakyll-bootstrap/pages/tos.html rename to hakyll-bootstrap/old.pages/tos.html diff --git a/hakyll-bootstrap/templates/archive.html b/hakyll-bootstrap/templates/archive.html index ccc167dd617646fb3f62db289d2a5ddad58d7c63..c681d7026ead1f9f7951662436d2f8eac8a816b9 100644 --- a/hakyll-bootstrap/templates/archive.html +++ b/hakyll-bootstrap/templates/archive.html @@ -23,7 +23,9 @@ <div class="container"> <h1>$title$</h1> + $if(pdfurl)$ <h3><a href="$pdfurl$">Le polycopié en entier [pdf]</a></h3> + $endif$ <h2>Les chapitres</h2> <ul> $for(posts)$ diff --git a/hakyll-bootstrap/templates/nav.html b/hakyll-bootstrap/templates/nav.html index 7e8137cd8089a0d11dddc31c568bd0faca2560d7..40836cf145a1ee08201cc7633e6085862a6af02a 100644 --- a/hakyll-bootstrap/templates/nav.html +++ b/hakyll-bootstrap/templates/nav.html @@ -17,18 +17,18 @@ <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> Classes <b class="caret"></b></a> <ul class="dropdown-menu"> - <li><a href="/phys_app.html">Physique appliquée</a></li> - <li><a href="/math_tech_info.html">Mathématiques en technologie de l'information</a></li> - <li><a href="/prog_seq.html">Programmation séquentielle en C</a></li> + <li><a href="/cours/phys_app.html">Physique appliquée</a></li> + <li><a href="/cours/math_tech_info.html">Mathématiques en technologie de l'information</a></li> + <li><a href="/cours/prog_seq.html">Programmation séquentielle en C</a></li> <li class="divider"></li> <li class="dropdown-header">Archived</li> <li><a href="#">Sciences orientation logicielle</a></li> <li><a href="#">Programmation séquentielle en Rust</a></li> - <li><a href="/prog_conc.html">Programmation concurrente</a></li> + <li><a href="/cours/prog_conc.html">Programmation concurrente</a></li> </ul> - <li><a href="/research_projects.html">Research projects</a></li> - <li><a href="/bachelor_projects.html">Bachelor projects</a></li> - <li><a href="/team.html">Team</a></li> + <li><a href="/pages/research_projects.html">Research projects</a></li> + <li><a href="/pages/bachelor_projects.html">Bachelor projects</a></li> + <li><a href="/pages/team.html">Team</a></li> <li><a href="/pages/contact.html">Contact </a></li> </li> </ul> diff --git a/hakyll-bootstrap/templates/posts.html b/hakyll-bootstrap/templates/posts.html new file mode 100644 index 0000000000000000000000000000000000000000..0ec1e09982b0094e2ac4fe255ff42dd3755bf71c --- /dev/null +++ b/hakyll-bootstrap/templates/posts.html @@ -0,0 +1,41 @@ +<!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> + <ul> + $for(posts)$ + <li> + <a href="$url$">$title$</a> - $date$ + </li> + $endfor$ + </ul> + $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>