diff --git a/attributions.md b/attributions.md new file mode 100644 index 0000000..7842c04 --- /dev/null +++ b/attributions.md @@ -0,0 +1,2 @@ +- Book by rivercon from the Noun Project +- [Git logo](https://git-scm.com/downloads/logos) by Jason Long diff --git a/books.xml b/books.xml new file mode 100644 index 0000000..977dc92 --- /dev/null +++ b/books.xml @@ -0,0 +1,7 @@ + + + 2019-05-28 + Uppo-Nallen talviturkki + read + + diff --git a/books/2014-07-10-pandoras-star.md b/books/2014-07-10-pandoras-star.md new file mode 100644 index 0000000..a2ca478 --- /dev/null +++ b/books/2014-07-10-pandoras-star.md @@ -0,0 +1,5 @@ +--- +title: Uppo-Nalle ja Nukku-Ukko +status: reading +--- + diff --git a/books/2016-11-04-the-fractal-prince.md b/books/2016-11-04-the-fractal-prince.md new file mode 100644 index 0000000..a08df3a --- /dev/null +++ b/books/2016-11-04-the-fractal-prince.md @@ -0,0 +1,4 @@ +--- +title: The Fractal Prince +status: reading +--- diff --git a/books/2019-05-28-nukku-ukko.md b/books/2019-05-28-nukku-ukko.md new file mode 100644 index 0000000..ceae3d2 --- /dev/null +++ b/books/2019-05-28-nukku-ukko.md @@ -0,0 +1,4 @@ +--- +title: Uppo-Nalle ja Nukku-Ukko +status: reading +--- diff --git a/books/2019-05-28-upponallen-talviturkki.md b/books/2019-05-28-upponallen-talviturkki.md new file mode 100644 index 0000000..922cc24 --- /dev/null +++ b/books/2019-05-28-upponallen-talviturkki.md @@ -0,0 +1,5 @@ +--- +title: Uppo-Nallen talviturkki +status: read +--- + diff --git a/css/default.css b/css/default.css index 381ff73..70924e7 100644 --- a/css/default.css +++ b/css/default.css @@ -51,6 +51,15 @@ article .header { text-decoration: none; } +.icon { + width: 2.4rem; + height: 2.4rem; + display: inline-flex; + align-self: center; + top: .40em; + position: relative; +} + @media (max-width: 319px) { body { width: 90%; diff --git a/images/book_read.svg b/images/book_read.svg new file mode 100644 index 0000000..e6d33b4 --- /dev/null +++ b/images/book_read.svg @@ -0,0 +1 @@ + diff --git a/images/book_reading.svg b/images/book_reading.svg new file mode 100644 index 0000000..f2f19d4 --- /dev/null +++ b/images/book_reading.svg @@ -0,0 +1 @@ + diff --git a/release.nix b/release.nix index 4157852..44656c1 100644 --- a/release.nix +++ b/release.nix @@ -6,10 +6,11 @@ let shell = pkgs.buildEnv { name = "site-shell"; paths = []; - buildInputs = [ - haskellPackages.ghcid - haskellPackages.hasktags - (haskellPackages.ghcWithHoogle (h: site.buildInputs ++ site.propagatedBuildInputs)) + buildInputs = with haskellPackages; [ + ghcid + hasktags + cabal-install + (ghcWithHoogle (h: site.buildInputs ++ site.propagatedBuildInputs)) ]; }; diff --git a/site.cabal b/site.cabal index a539b59..9943d02 100644 --- a/site.cabal +++ b/site.cabal @@ -12,5 +12,8 @@ executable site build-depends: base == 4.* , hakyll >= 4.10 , time + , xml-conduit + , xml-lens + , lens ghc-options: -threaded default-language: Haskell2010 diff --git a/site.hs b/site.hs index 909f71a..c99e5d8 100644 --- a/site.hs +++ b/site.hs @@ -5,6 +5,10 @@ import Hakyll import Data.List (sortBy, sortOn) import Data.Time (formatTime, defaultTimeLocale) +data Book = + Book { title :: String + , date :: Day + , status :: String } -------------------------------------------------------------------------------- main :: IO () @@ -31,6 +35,13 @@ main = hakyllWith defaultConfiguration{ deployCommand = "ipfs add -Q -r _site" } >>= loadAndApplyTemplate "templates/default.html" defaultContext >>= relativizeUrls + match "books/*" $ do + route $ setExtension "html" + compile $ pandocCompiler + >>= loadAndApplyTemplate "templates/post.html" postCtx + >>= loadAndApplyTemplate "templates/default.html" postCtx + >>= relativizeUrls + match "posts/incomplete/*" $ do route $ setExtension "html" compile $ pandocCompiler @@ -52,6 +63,18 @@ main = hakyllWith defaultConfiguration{ deployCommand = "ipfs add -Q -r _site" } >>= loadAndApplyTemplate "templates/default.html" postCtx >>= relativizeUrls + create ["books.html"] $ do + route idRoute + compile $ do + books <- reverse <$> loadAll "books/*" + let ctx = listField "books" postCtx (pure books) <> + constField "title" "Books" <> + defaultContext + makeItem "" + >>= loadAndApplyTemplate "templates/books.html" ctx + >>= loadAndApplyTemplate "templates/default.html" ctx + >>= relativizeUrls + create ["guides.html"] $ do route idRoute compile $ do diff --git a/templates/books.html b/templates/books.html new file mode 100644 index 0000000..b56eaf3 --- /dev/null +++ b/templates/books.html @@ -0,0 +1,9 @@ +A collection of books I have read lately. + + diff --git a/templates/default.html b/templates/default.html index bca328a..bdce092 100644 --- a/templates/default.html +++ b/templates/default.html @@ -28,7 +28,7 @@