diff --git a/ChangeLog.md b/ChangeLog.md index f62e830..3b3110e 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -3,3 +3,7 @@ ## 0.1.0.0 -- 2018-08-18 * First version, counting from when I got around to putting it on git. + +## 0.1.0.1 -- 2018-08-19 + +* Cleaned up the code a bit diff --git a/archive.md b/archive.md index 07841e8..ed94ed3 100644 --- a/archive.md +++ b/archive.md @@ -1,3 +1,7 @@ +--- +title: Archives +--- + you access archives and find: * An [SSL Endorsement](https://netrunnerdb.com/en/card/21038) diff --git a/default.nix b/default.nix index 00b183c..6902f48 100644 --- a/default.nix +++ b/default.nix @@ -1,7 +1,7 @@ { mkDerivation, base, filepath, hakyll, stdenv }: mkDerivation { pname = "rf"; - version = "0.1.0.0"; + version = "0.1.0.1"; src = ./.; isLibrary = false; isExecutable = true; diff --git a/rf.cabal b/rf.cabal index fee592e..1b7ae81 100644 --- a/rf.cabal +++ b/rf.cabal @@ -2,7 +2,7 @@ -- see http://haskell.org/cabal/users-guide/ name: rf -version: 0.1.0.0 +version: 0.1.0.1 synopsis: tA's blog -- description: homepage: regularflolloping.com diff --git a/site.hs b/site.hs index 7248b56..78c4695 100644 --- a/site.hs +++ b/site.hs @@ -1,7 +1,7 @@ {-# LANGUAGE OverloadedStrings #-} import Hakyll -import Data.Monoid (mappend) +import Data.Monoid ((<>)) import Data.List (sortBy,isSuffixOf) import System.FilePath.Posix (takeBaseName,takeDirectory,()) import GHC.IO.Encoding @@ -14,10 +14,6 @@ main = do route idRoute compile copyFileCompiler - match "images/*" $ do - route idRoute - compile copyFileCompiler - match "css/*" $ do route idRoute compile compressCssCompiler @@ -25,23 +21,22 @@ main = do match (fromList ["about.md", "contact.md"]) $ do route $ cleanRoute compile $ pandocCompiler - >>= loadAndApplyTemplate "templates/default.html" defaultContext + >>= loadAndApplyTemplate "templates/default.html" ctx >>= relativizeUrls >>= cleanIndexUrls match "archive.md" $ do route $ cleanRoute compile $ pandocCompiler - >>= loadAndApplyTemplate "templates/archive.html" defaultContext + >>= loadAndApplyTemplate "templates/archive.html" ctx >>= relativizeUrls >>= cleanIndexUrls compile $ do posts <- recentFirst =<< loadAll "posts/*" let archiveCtx = - listField "posts" postCtx (return posts) `mappend` - constField "title" "Archives" `mappend` - defaultContext + listField "posts" postCtx (return posts) <> + ctx pandocCompiler >>= loadAndApplyTemplate "templates/archive.html" archiveCtx >>= loadAndApplyTemplate "templates/default.html" archiveCtx @@ -57,18 +52,13 @@ main = do >>= cleanIndexUrls >>= cleanIndexHtmls - create ["archive/index.html"] $ do - route idRoute - match "index.html" $ do route idRoute compile $ do posts <- recentFirst =<< loadAll "posts/*" let indexCtx = - listField "posts" postCtx (return posts) `mappend` - constField "title" "Home" `mappend` + listField "posts" postCtx (return posts) <> defaultContext - getResourceBody >>= applyAsTemplate indexCtx >>= loadAndApplyTemplate "templates/default.html" indexCtx @@ -78,10 +68,12 @@ main = do match "templates/*" $ compile templateBodyCompiler +ctx :: Context String +ctx = defaultContext + postCtx :: Context String postCtx = - dateField "date" "%B %e, %Y" `mappend` - defaultContext + (dateField "date" "%B %e, %Y") <> ctx cleanRoute :: Routes cleanRoute = customRoute createIndexRoute