From f2da99bab42d9951201b1af8425c0e45c05e099e Mon Sep 17 00:00:00 2001 From: Orestis Malaspinas <orestis.malaspinas@hesge.ch> Date: Sun, 19 Apr 2020 16:35:11 +0200 Subject: [PATCH] added hakyll images. don't know hot to use it yet... --- hakyll-bootstrap/Main.hs | 14 ++++++++++++-- hakyll-bootstrap/hakyll-bootstrap.cabal | 5 +++-- hakyll-bootstrap/index.html | 8 ++++---- hakyll-bootstrap/stack.yaml | 1 + 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/hakyll-bootstrap/Main.hs b/hakyll-bootstrap/Main.hs index 6780e31..4874edd 100644 --- a/hakyll-bootstrap/Main.hs +++ b/hakyll-bootstrap/Main.hs @@ -18,7 +18,9 @@ import Text.Pandoc import qualified Data.Map as M import Data.Maybe (isJust) import Text.Pandoc.Highlighting - +import Hakyll.Images ( loadImage + , scaleImageCompiler + ) -------------------------------------------------------------------- -- Contexts @@ -67,6 +69,13 @@ static = do route idRoute compile $ copyFileCompiler +resize :: Rules () +resize = do + match "img/**.png" $ do + route idRoute + compile $ loadImage + >>= scaleImageCompiler 140 140 + pages :: Rules () pages = do match "pages/*" $ do @@ -184,7 +193,6 @@ cfg = defaultConfiguration main :: IO () main = hakyllWith cfg $ do - static pages posts cours @@ -192,3 +200,5 @@ main = hakyllWith cfg $ do archive index templates + static + diff --git a/hakyll-bootstrap/hakyll-bootstrap.cabal b/hakyll-bootstrap/hakyll-bootstrap.cabal index 84928cd..47a2a24 100644 --- a/hakyll-bootstrap/hakyll-bootstrap.cabal +++ b/hakyll-bootstrap/hakyll-bootstrap.cabal @@ -3,8 +3,8 @@ version: 0.1.0.0 license: MIT license-file: LICENSE category: Web -author: Stephen Diehl -maintainer: stephen.m.diehl@gmail.com +author: Orestis Malaspinas +maintainer: orestis.malaspinas@hesge.ch build-type: Simple cabal-version: >=1.16 @@ -17,3 +17,4 @@ executable blog , pandoc , pandoc-crossref , hakyll + , hakyll-images diff --git a/hakyll-bootstrap/index.html b/hakyll-bootstrap/index.html index da62603..85f77ad 100644 --- a/hakyll-bootstrap/index.html +++ b/hakyll-bootstrap/index.html @@ -35,7 +35,7 @@ <div class="carousel-caption"> <h1></h1> <p></p> - <p><a class="btn btn-lg btn-primary" href="/pages/signup.html" role="button">Sign up today</a></p> + <p><a class="btn btn-lg btn-primary" href="https://www.palabos.org" role="button">Palabos</a></p> </div> </div> </div> @@ -45,7 +45,7 @@ <div class="carousel-caption"> <h1></h1> <p></p> - <p><a class="btn btn-lg btn-primary" href="#" role="button">Learn more</a></p> + <p><a class="btn btn-lg btn-primary" href="https://www.mixer.com/omhepia" role="button">Live stream</a></p> </div> </div> </div> @@ -71,8 +71,8 @@ <div class="row"> <div class="col-lg-4"> - <img class="img-circle" data-src="holder.js/140x140" alt="Generic placeholder image"> - <h2>Heading 1</h2> + <img src="img/boltzmann.png" class="img-circle" data-src="img/boltzmann.png" alt="Generic placeholder image" src='./boltzmann.png'> + <h2>Palabos</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam non est in neque luctus eleifend. Sed tincidunt vestibulum facilisis. Aenean ut pulvinar massa. diff --git a/hakyll-bootstrap/stack.yaml b/hakyll-bootstrap/stack.yaml index 7a0950d..7a0e8ad 100644 --- a/hakyll-bootstrap/stack.yaml +++ b/hakyll-bootstrap/stack.yaml @@ -43,6 +43,7 @@ extra-deps: - pandoc-crossref-0.3.6.2 - data-accessor-template-0.2.1.16 - roman-numerals-0.5.1.5 + - hakyll-images-0.4.4 # Override default flag values for local packages and extra-deps # flags: {} -- GitLab