From 603f0fd93dcd9c913d4a2b5c708dca1a7a40776f Mon Sep 17 00:00:00 2001 From: Orestis <orestis.malaspinas@hesge.ch> Date: Sat, 21 Nov 2020 16:04:44 +0100 Subject: [PATCH] added course template and modified archive --- hakyll-bootstrap/Main.hs | 6 ++-- hakyll-bootstrap/templates/archive.html | 4 --- hakyll-bootstrap/templates/course.html | 45 +++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 hakyll-bootstrap/templates/course.html diff --git a/hakyll-bootstrap/Main.hs b/hakyll-bootstrap/Main.hs index 0d9d50b..a8484aa 100644 --- a/hakyll-bootstrap/Main.hs +++ b/hakyll-bootstrap/Main.hs @@ -78,7 +78,7 @@ main = hakyllWith config $ do compile $ do posts <- recentFirst =<< loadAll ("cours/isc_physics/*.markdown" .&&. hasNoVersion) makeItem "" - >>= loadAndApplyTemplate "templates/archive.html" (courseCtx posts "Physique appliquée" "cours/isc_physics/cours.pdf") + >>= loadAndApplyTemplate "templates/course.html" (courseCtx posts "Physique appliquée" "cours/isc_physics/cours.pdf") >>= relativizeUrls -- Math Tech Info posts @@ -104,7 +104,7 @@ main = hakyllWith config $ do compile $ do posts <- recentFirst =<< loadAll ("cours/math_tech_info/*.markdown" .&&. hasNoVersion) makeItem "" - >>= loadAndApplyTemplate "templates/archive.html" (courseCtx posts "Mathématiques en technologie de l'information" "cours/math_tech_info/cours.pdf") + >>= loadAndApplyTemplate "templates/course.html" (courseCtx posts "Mathématiques en technologie de l'information" "cours/math_tech_info/cours.pdf") >>= relativizeUrls -- Phys app posts @@ -167,7 +167,7 @@ main = hakyllWith config $ do compile $ do posts <- recentFirst =<< loadAll "posts/bachelor/*.md" makeItem "" - >>= loadAndApplyTemplate "templates/archive.html" (pagesCtx posts "Bachelor projects") + >>= loadAndApplyTemplate "templates/page.html" (pagesCtx posts "Bachelor projects") >>= relativizeUrls -- Render some static pages diff --git a/hakyll-bootstrap/templates/archive.html b/hakyll-bootstrap/templates/archive.html index c681d70..0ec1e09 100644 --- a/hakyll-bootstrap/templates/archive.html +++ b/hakyll-bootstrap/templates/archive.html @@ -23,10 +23,6 @@ <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)$ <li> diff --git a/hakyll-bootstrap/templates/course.html b/hakyll-bootstrap/templates/course.html new file mode 100644 index 0000000..c681d70 --- /dev/null +++ b/hakyll-bootstrap/templates/course.html @@ -0,0 +1,45 @@ +<!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> + <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> -- GitLab