commit cc965423db2631135ca605516ab37949fb167042 Author: Julien Marquet Date: Wed Jan 31 16:20:02 2024 +0100 Template website diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4118257 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +dist-newstyle +_cache +_site +result diff --git a/Main.hs b/Main.hs new file mode 100644 index 0000000..1f55936 --- /dev/null +++ b/Main.hs @@ -0,0 +1,31 @@ +{-# LANGUAGE OverloadedStrings #-} + +import qualified GHC.IO.Encoding as E +import Data.Monoid (mappend) +import Hakyll + +main :: IO () +main = do + E.setLocaleEncoding E.utf8 + hakyll $ do + match "assets/css/*" $ do + route idRoute + compile compressCssCompiler + + match "assets/images/*" $ do + route idRoute + compile copyFileCompiler + + {-match "index.md" $ do + route $ setExtension "html" + compile $ pandocCompiler + >>= loadAndApplyTemplate "layouts/default.html" defaultContext + >>= relativizeUrls-} + + match "index.html" $ do + route $ idRoute + compile $ getResourceBody + >>= relativizeUrls + + match "layouts/*" $ compile templateBodyCompiler + diff --git a/assets/css/style.css b/assets/css/style.css new file mode 100644 index 0000000..58c4c46 --- /dev/null +++ b/assets/css/style.css @@ -0,0 +1,68 @@ + +body { + margin: 40px auto; + max-width: 650px; + font-size: 18px; + padding: 0 10px; +} + +ul { + margin: 0; +} + +.pic { + float: right; + width: 200px; +} + +.pic-small { + float: right; + width: 80px; + display: none; +} + +.lightbox { + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + padding: 1em; + backdrop-filter: blur(2px); + visibility: hidden; + opacity: 0; + transition: visibility 0s, opacity 0.2s linear; +} + +.lightbox:target { + visibility: visible; + opacity: 1; +} + +.lightbox span { + display: block; + width: 100%; + height: 100%; + background-position: center; + background-repeat: no-repeat; + background-size: contain; +} + +@media (max-width: 650px) { + body { + font-size: 14px; + } + + .pic { + display: none; + } + + .pic-small { + display: block; + } +} + +.headpar { + margin: 18px 0; +} + diff --git a/assets/images/pic.jpg b/assets/images/pic.jpg new file mode 100644 index 0000000..9992877 Binary files /dev/null and b/assets/images/pic.jpg differ diff --git a/assets/images/pic_square.jpg b/assets/images/pic_square.jpg new file mode 100644 index 0000000..0670d2a Binary files /dev/null and b/assets/images/pic_square.jpg differ diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..7a55b20 --- /dev/null +++ b/default.nix @@ -0,0 +1,17 @@ +{ pkgs ? import {} }: +let + #ssg = pkgs.haskellPackages.callPackage ./simiweb.nix {}; + src = pkgs.nix-gitignore.gitignoreSource [] ./.; + ssg = pkgs.haskellPackages.callCabal2nix "simiweb" src {}; +in { + site = pkgs.stdenv.mkDerivation { + name = "simiweb"; + src = pkgs.nix-gitignore.gitignoreSource [] ./.; + buildPhase = '' + ${ssg}/bin/ssg build + ''; + installPhase = '' + mv _site $out + ''; + }; +} diff --git a/index.html b/index.html new file mode 100644 index 0000000..23a37af --- /dev/null +++ b/index.html @@ -0,0 +1,32 @@ + + + + + + + + +
+ + + + + +

Sessions Informelles Maths-Info

+
+ Organisées à l'École Normale Supérieure - PSL +
+
+ Notre but est de : +
    +
  • Faire des présentations intéressantes
  • +
  • Passer un bon moment et manger
  • +
+
+
+ On aime bien les panthères, la photo vient + d'ici. +
+
+ + diff --git a/layouts/default.html b/layouts/default.html new file mode 100644 index 0000000..8a72609 --- /dev/null +++ b/layouts/default.html @@ -0,0 +1,10 @@ + + + + + + + + $body$ + + diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..f516a9d --- /dev/null +++ b/shell.nix @@ -0,0 +1,13 @@ +{ pkgs ? import {} }: +let + src = pkgs.nix-gitignore.gitignoreSource [] ./.; +in pkgs.haskellPackages.shellFor { + packages = hpkgs: [ + (hpkgs.callCabal2nix "simiweb" src {}) + ]; + nativeBuildInputs = [ + pkgs.cabal-install + pkgs.cabal2nix + pkgs.haskell-language-server + ]; +} diff --git a/simiweb.cabal b/simiweb.cabal new file mode 100644 index 0000000..3cb6fca --- /dev/null +++ b/simiweb.cabal @@ -0,0 +1,14 @@ +cabal-version: 1.12 + +name: simiweb +version: 0.0.0 +build-type: Simple + +executable ssg + main-is: Main.hs + other-modules: + Paths_simiweb + build-depends: + base + , hakyll + default-language: Haskell2010 diff --git a/simiweb.nix b/simiweb.nix new file mode 100644 index 0000000..3268449 --- /dev/null +++ b/simiweb.nix @@ -0,0 +1,11 @@ +{ mkDerivation, base, hakyll, lib }: +mkDerivation { + pname = "simiweb"; + version = "0.0.0"; + src = ./.; + isLibrary = false; + isExecutable = true; + executableHaskellDepends = [ base hakyll ]; + license = "unknown"; + mainProgram = "ssg"; +} diff --git a/style.css b/style.css new file mode 100644 index 0000000..59a5f6d --- /dev/null +++ b/style.css @@ -0,0 +1,20 @@ + +body { + margin: 40px auto; + max-width: 650px; + font-size: 18px; + padding: 0 10px; +} + +ul { + margin: 0; +} + +.pic { + float: right; +} + +.headpar { + margin: 18px 0; +} +