about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--LICENSE30
-rw-r--r--README.md2
-rw-r--r--dybiec-info.cabal15
-rw-r--r--flake.lock60
-rw-r--r--flake.nix45
-rw-r--r--images/profile.webpbin15248 -> 2912 bytes
-rw-r--r--index.md19
-rw-r--r--pdybiec.cabal11
-rw-r--r--robots.txt5
-rw-r--r--site.hs112
-rw-r--r--stack.yaml5
-rw-r--r--stack.yaml.lock19
-rw-r--r--templates/default.html17
-rw-r--r--templates/post.html2
14 files changed, 222 insertions, 120 deletions
diff --git a/LICENSE b/LICENSE
index 2d2bab1..fd7f1f2 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,22 +1,16 @@
-Copyright (c) <year> <owner>. All rights reserved.
+Copyright 2023 dyniec
 
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
 
-1. Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
 
-2. Redistributions in binary form must reproduce the above copyright notice,
-this list of conditions and the following disclaimer in the documentation
-and/or other materials provided with the distribution.
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
 
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
-USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
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/dybiec-info.cabal b/dybiec-info.cabal
new file mode 100644
index 0000000..dbdd72d
--- /dev/null
+++ b/dybiec-info.cabal
@@ -0,0 +1,15 @@
+cabal-version:      3.4
+name:               dybiec-info
+version:            0.1.0.0
+build-type:         Simple
+license:            BSD-3-Clause
+license-file:		LICENSE
+description:
+  My website
+homepage:           https://git.dybiec.info/website
+
+executable site
+  main-is:          site.hs
+  build-depends:    base == 4.*
+                  , 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 1f65487..f2d106d 100644
--- a/index.md
+++ b/index.md
@@ -1,24 +1,27 @@
 ---
 title: About me
 ---
-## Who I am
-Hi! My name is Paweł Dybiec.
-I was born in 1995, and spent most of my life in Wrocław, Poland.
+## > whoami
+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.
 
-* enjoys functional programming
+* functional programming fan
 * operating systems enthusiast
-* still haven't finished my master's degree in Computer Science at [University of Wrocław](http://ii.uni.wroc.pl/)
-* PE at facebook
+* [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 "mars" rover
-* [Pizza contest](https://contest.pizza/) 
+* [Continuum Science Club](http://continuum.uni.wroc.pl/) - Prototype of "martian" rover
+* [Pizza contest](https://contest.pizza/) - Competition of computer bots on virtual arena
 
 ## Contact
 You can reach me by using:
 
 * email: pawel at dybiec.info
 * matrix: \@dyniec:matrix.org
+* dyniec at libera.chat
+* <a rel="me" href="https://tech.lgbt/@dyniec">Mastodon</a>
 
 ## PGP key
 Fingerprint: [D981 E3D6 24C1 1C20 B04F  CD2B 2397 F066 368B 6FD9](static/dyniec.asc)
diff --git a/pdybiec.cabal b/pdybiec.cabal
deleted file mode 100644
index 4b154dc..0000000
--- a/pdybiec.cabal
+++ /dev/null
@@ -1,11 +0,0 @@
-name:               pdybiec
-version:            0.1.0.0
-build-type:         Simple
-cabal-version:      >= 1.10
-
-executable site
-  main-is:          site.hs
-  build-depends:    base == 4.*
-                  , hakyll == 4.13.*
-  ghc-options:      -threaded
-  default-language: Haskell2010
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/stack.yaml b/stack.yaml
deleted file mode 100644
index eddff00..0000000
--- a/stack.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
-resolver: lts-15.10
-packages:
-- .
-extra-deps:
-- hakyll-4.13.3.0
diff --git a/stack.yaml.lock b/stack.yaml.lock
deleted file mode 100644
index 3da7375..0000000
--- a/stack.yaml.lock
+++ /dev/null
@@ -1,19 +0,0 @@
-# This file was autogenerated by Stack.
-# You should not edit this file by hand.
-# For more information, please see the documentation at:
-#   https://docs.haskellstack.org/en/stable/lock_files
-
-packages:
-- completed:
-    hackage: hakyll-4.13.3.0@sha256:7d8903f03974691aec049a6188ace8d93457563bad9f078c6faf4c9156e27a33,8867
-    pantry-tree:
-      size: 7841
-      sha256: bdbacc241f680dd0c8d7666c9ec4e7d230dad85172067e106cc35f7c125cd7ab
-  original:
-    hackage: hakyll-4.13.3.0
-snapshots:
-- completed:
-    size: 493124
-    url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/15/10.yaml
-    sha256: 48bc6d1d59224a5166265ef6cdda6a512f29ecc8ef7331826312b82377e89507
-  original: lts-15.10
diff --git a/templates/default.html b/templates/default.html
index 2ab8460..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>
@@ -37,8 +38,8 @@
 	
       </div>
       <footer>
-        Site proudly generated by
-        <a href="http://jaspervdj.be/hakyll">Hakyll</a>
+	<a href=https://git.dybiec.info/website/>Site</a> proudly generated by
+        <a href="https://jaspervdj.be/hakyll">Hakyll</a>
       </footer>
     </main>
   </body>
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$