From 3ac48903e74d03ec9eb1a639eb3549b28c3891a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abigail=20Magalh=C3=A3es?= Date: Fri, 15 Jan 2021 23:36:30 -0300 Subject: [PATCH] Fix post listings & add comments --- site.hs | 6 +++--- templates/post.html | 21 ++++++++++++++++----- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/site.hs b/site.hs index e2be0c1..a9b6d83 100644 --- a/site.hs +++ b/site.hs @@ -196,7 +196,7 @@ main = (*>) (setEnv "AMC_LIBRARY_PATH" "/usr/lib/amuletml/lib/") $ hakyllWith co create ["archive.html"] $ do route idRoute compile $ do - posts <- recentFirst =<< loadAll "posts/*" + posts <- recentFirst =<< loadAll "pages/posts/*" let archiveCtx = listField "posts" postCtx (return posts) <> constField "title" "Archives" <> @@ -209,7 +209,7 @@ main = (*>) (setEnv "AMC_LIBRARY_PATH" "/usr/lib/amuletml/lib/") $ hakyllWith co match "pages/*.html" $ do route $ gsubRoute "pages/" (const "") compile $ do - posts <- fmap (take 5) . recentFirst =<< loadAll "posts/*" + posts <- fmap (take 5) . recentFirst =<< loadAll "pages/posts/*" let indexCtx = listField "posts" postCtx (return posts) <> constField "title" "Home" <> @@ -241,7 +241,7 @@ main = (*>) (setEnv "AMC_LIBRARY_PATH" "/usr/lib/amuletml/lib/") $ hakyllWith co route idRoute compile $ do let feedCtx = postCtx <> bodyField "description" - posts <- (take 10 <$>) . recentFirst =<< loadAllSnapshots "posts/*" "content" + posts <- (take 10 <$>) . recentFirst =<< loadAllSnapshots "pages/posts/*" "content" renderRss rssfeed feedCtx posts postCtx :: Context String diff --git a/templates/post.html b/templates/post.html index f092672..c15794c 100644 --- a/templates/post.html +++ b/templates/post.html @@ -1,10 +1,21 @@
- Posted on $date$ - $if(author)$ - by $author$ - $endif$ + Posted on $date$
+ Comment on this post here
$body$ -
\ No newline at end of file + + +
+ +
+ +
\ No newline at end of file