diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | default.nix | 11 | ||||
-rw-r--r-- | dybiec-info.cabal | 2 | ||||
-rw-r--r-- | flake.lock | 60 | ||||
-rw-r--r-- | flake.nix | 45 | ||||
-rw-r--r-- | images/profile.webp | bin | 15248 -> 2912 bytes | |||
-rw-r--r-- | index.md | 14 | ||||
-rw-r--r-- | release.nix | 4 | ||||
-rw-r--r-- | robots.txt | 5 | ||||
-rw-r--r-- | site.hs | 112 | ||||
-rw-r--r-- | templates/default.html | 13 | ||||
-rw-r--r-- | templates/post.html | 2 |
12 files changed, 189 insertions, 81 deletions
diff --git a/README.md b/README.md index d9bfd3b..0cc16db 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ # website - +To build website use `LANG=C.UTF-8 nix run .#default -- rebuild` diff --git a/default.nix b/default.nix deleted file mode 100644 index 37bc31f..0000000 --- a/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ mkDerivation, base, hakyll, lib }: -mkDerivation { - pname = "dybiec-info"; - version = "0.1.0.0"; - src = ./.; - isLibrary = false; - isExecutable = true; - executableHaskellDepends = [ base hakyll ]; - license = "unknown"; - mainProgram = "site"; -} diff --git a/dybiec-info.cabal b/dybiec-info.cabal index 5447fdb..dbdd72d 100644 --- a/dybiec-info.cabal +++ b/dybiec-info.cabal @@ -11,5 +11,5 @@ homepage: https://git.dybiec.info/website executable site main-is: site.hs build-depends: base == 4.* - , hakyll == 4.15.* + , hakyll >= 4.15 ghc-options: -threaded diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..6a88238 --- /dev/null +++ b/flake.lock @@ -0,0 +1,60 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1692799911, + "narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1692976428, + "narHash": "sha256-uefE4anjrZewcXqT9gbvbbLgEaKtuNdJPg8/MZSEUmA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9ce6dcf311dfdb3ce2d8181e9e0bd0c7db71148b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..952ae3f --- /dev/null +++ b/flake.nix @@ -0,0 +1,45 @@ +# SPDX-FileCopyrightText: 2021 Serokell <https://serokell.io/> +# +# SPDX-License-Identifier: CC0-1.0 + +{ + description = "My haskell application"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + + haskellPackages = pkgs.haskellPackages; + + jailbreakUnbreak = pkg: + pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; })); + + packageName = "dybiec-info"; + in + { + packages.${packageName} = + haskellPackages.callCabal2nix packageName self rec { + + # Dependency overrides go here + }; + + packages.default = self.packages.${system}.${packageName}; + defaultPackage = self.packages.${system}.default; + + devShells.default = pkgs.mkShell { + buildInputs = with pkgs; [ + haskellPackages.haskell-language-server # you must build it with your ghc to work + ghcid + cabal-install + ]; + inputsFrom = map (__getAttr "env") (__attrValues self.packages.${system}); + }; + devShell = self.devShells.${system}.default; + }); +} diff --git a/images/profile.webp b/images/profile.webp index 3ea6909..38ed4f6 100644 --- a/images/profile.webp +++ b/images/profile.webp Binary files differdiff --git a/index.md b/index.md index 2f0c187..f2d106d 100644 --- a/index.md +++ b/index.md @@ -2,13 +2,14 @@ title: About me --- ## > whoami -Hi! I'm Paweł. -I'm 26 and spent most of my life in Wrocław, Poland. Currently living in Dublin, Ireland. +Hi! I'm Paweł(he/him). I'm 28 and I have spent most of my life in Wrocław, Poland. Since 2020 living in Dublin, Ireland. +In free time I work with Haskell, Nix and Rust. +In my work I deal with highly distributed systems that make sure our server fleet is in a good shape. * functional programming fan * operating systems enthusiast -* Planning to finish my master's degree in Computer Science at [University of Wrocław](http://ii.uni.wroc.pl/) in ~~2020~~ ~~2021~~ 2022 -* PE at ~~facebook~~ Meta +* [University of Wrocław](http://ii.uni.wroc.pl/)'s alumni - ISIM (Individual Computer Science and Mathematical Studies) +* since 2020 - PE at ~~facebook~~ Meta ## Projects * [Continuum Science Club](http://continuum.uni.wroc.pl/) - Prototype of "martian" rover @@ -19,10 +20,7 @@ You can reach me by using: * email: pawel at dybiec.info * matrix: \@dyniec:matrix.org - -If I were to post bad takes you would find them here: - -* [Twitter](https://twitter.com/dyniecc) +* dyniec at libera.chat * <a rel="me" href="https://tech.lgbt/@dyniec">Mastodon</a> ## PGP key diff --git a/release.nix b/release.nix deleted file mode 100644 index d993916..0000000 --- a/release.nix +++ /dev/null @@ -1,4 +0,0 @@ -let - pkgs = import <nixpkgs> { }; -in - pkgs.haskellPackages.callPackage ./default.nix { } diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000..ed8c524 --- /dev/null +++ b/robots.txt @@ -0,0 +1,5 @@ +User-agent: GPTBot +Disallow: / + +User-agent: * +Allow: / \ No newline at end of file diff --git a/site.hs b/site.hs index 7abbee7..47230de 100644 --- a/site.hs +++ b/site.hs @@ -1,62 +1,74 @@ -------------------------------------------------------------------------------- {-# LANGUAGE OverloadedStrings #-} -import Data.Monoid (mappend) -import Hakyll +import Control.Monad (filterM) +import Data.Maybe (isJust) +import Data.Monoid (mappend) +import Hakyll -------------------------------------------------------------------------------- main :: IO () main = hakyll $ do - match "images/*" $ do - route idRoute - compile copyFileCompiler - - match "static/*" $ do - route idRoute - compile copyFileCompiler - - match "css/*" $ compile compressCssCompiler - create ["style.css"] $ do - route idRoute - compile $ do - csses <- loadAll "css/*.css" - makeItem $ unlines $ map itemBody csses - - match (fromList ["index.md"]) $ do - route $ setExtension "html" - compile $ pandocCompiler - >>= loadAndApplyTemplate "templates/default.html" defaultContext - >>= relativizeUrls - - - match "posts/*" $ do - route $ setExtension "html" - compile $ pandocCompiler - >>= loadAndApplyTemplate "templates/post.html" postCtx - >>= loadAndApplyTemplate "templates/default.html" postCtx - >>= relativizeUrls - - create ["archive.html"] $ do - route idRoute - compile $ do - posts <- recentFirst =<< loadAll "posts/*" - let archiveCtx = - listField "posts" postCtx (return posts) `mappend` - constField "title" "Archives" `mappend` - defaultContext - - makeItem "" - >>= loadAndApplyTemplate "templates/archive.html" archiveCtx - >>= loadAndApplyTemplate "templates/default.html" archiveCtx - >>= relativizeUrls - - - - match "templates/*" $ compile templateBodyCompiler + match "images/*" $ do + route idRoute + compile copyFileCompiler + match "static/*" $ do + route idRoute + compile copyFileCompiler + + match (fromList ["robots.txt"]) $ do + route idRoute + compile copyFileCompiler + + match "css/*" $ compile compressCssCompiler + create ["style.css"] $ do + route idRoute + compile $ do + csses <- loadAll "css/*.css" + makeItem $ unlines $ map itemBody csses + + match (fromList ["index.md"]) $ do + route $ setExtension "html" + compile $ + pandocCompiler + >>= loadAndApplyTemplate "templates/default.html" defaultContext + >>= relativizeUrls + + match "posts/*" $ do + route $ setExtension "html" + compile $ + pandocCompiler + >>= loadAndApplyTemplate "templates/post.html" postCtx + >>= loadAndApplyTemplate "templates/default.html" postCtx + >>= relativizeUrls + + create ["posts.html"] $ do + route idRoute + compile $ do + posts <- recentFirst =<< filterPublished =<< loadAll "posts/*" + let archiveCtx = + listField "posts" postCtx (return posts) + `mappend` constField "title" "Archives" + `mappend` defaultContext + + makeItem "" + >>= loadAndApplyTemplate "templates/archive.html" archiveCtx + >>= loadAndApplyTemplate "templates/default.html" archiveCtx + >>= relativizeUrls + + match "templates/*" $ compile templateBodyCompiler -------------------------------------------------------------------------------- postCtx :: Context String postCtx = - dateField "date" "%B %e, %Y" `mappend` - defaultContext + dateField "date" "%B %e, %Y" + `mappend` defaultContext + +filterPublished :: (MonadMetadata m, MonadFail m) => [Item a] -> m [Item a] +filterPublished = filterM $ isPublished . itemIdentifier + where + isPublished :: (MonadMetadata m, MonadFail m) => Identifier -> m Bool + isPublished id' = do + metadata <- getMetadata id' + pure $ isJust $ lookupString "date" metadata diff --git a/templates/default.html b/templates/default.html index 1ea6fa1..d3f2ca0 100644 --- a/templates/default.html +++ b/templates/default.html @@ -1,19 +1,20 @@ <!doctype html> <html lang="en"> <head> - <meta charset="utf-8"> - <meta http-equiv="x-ua-compatible" content="ie=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1"> + <meta charset="utf-8"/> + <meta http-equiv="x-ua-compatible" content="ie=edge"/> + <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>dyniec - $title$</title> <link rel="stylesheet" href="/style.css" /> - <link rel="icon" type="image/png" href="images/icon.png"/> - <link rel="apple-touch-icon" type="image/png" href="images/icon.png"/> + <link rel="icon" type="image/png" href="/images/icon.png"/> + <link rel="apple-touch-icon" type="image/png" href="/images/icon.png"/> </head> <body> <aside> <div> <a href="/"> - <img src="/images/profile.webp" type="image/webp" alt="dyniec's website" title="dyniec's website"> + <img src="/images/profile.webp" type="image/webp" alt="dyniec's website" title="dyniec's website" + width="120" height="120"> </a> <nav> diff --git a/templates/post.html b/templates/post.html index 732149b..30b75a1 100644 --- a/templates/post.html +++ b/templates/post.html @@ -1,6 +1,8 @@ <article> <section class="header"> + $if(date)$ Posted on $date$ + $endif$ $if(author)$ by $author$ $endif$ |