From 084cbd7552ff8dae481bcd7ddef4a6c99964c3d8 Mon Sep 17 00:00:00 2001 From: Lucian Mogosanu Date: Thu, 2 Jan 2014 11:38:15 +0200 Subject: [PATCH] site: move tags to archive --- index.html | 1 - site.hs | 12 ++++++------ templates/archive.html | 7 ++++++- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index 48204db..49257fd 100644 --- a/index.html +++ b/index.html @@ -12,4 +12,3 @@ $partial("templates/post-list.html")$

Labels

-$taglist$ diff --git a/site.hs b/site.hs index e3e2d82..549cfff 100644 --- a/site.hs +++ b/site.hs @@ -19,7 +19,7 @@ main = hakyllWith tarpitConfiguration $ do match "images/**" $ compileImages match "css/fonts/*" $ compileFonts match (fromList pages) compilePages - create ["archive.html"] compileArchive + create ["archive.html"] $ compileArchive tags -- tags rules tagsRules tags $ compileTags tags @@ -38,7 +38,6 @@ compileIndex tags = do posts <- loadAll "posts/**" >>= fmap (take 5) . recentFirst let indexCtx = listField "posts" postCtx (return posts) `mappend` - field "taglist" (const $ renderTagList tags) `mappend` defaultContext getResourceBody @@ -77,14 +76,15 @@ compilePages = do -- relative URLs break 404 pages, so don't do it here -- >>= relativizeUrls -compileArchive :: Rules () -compileArchive = do +compileArchive :: Tags -> Rules () +compileArchive tags = do route idRoute compile $ do posts <- loadAll "posts/**" >>= recentFirst let archiveCtx = - listField "posts" postCtx (return posts) `mappend` - constField "title" "Archive" `mappend` + listField "posts" postCtx (return posts) `mappend` + field "taglist" (const $ renderTagList tags) `mappend` + constField "title" "Archive" `mappend` defaultContext makeItem "" >>= loadAndApplyTemplate "templates/archive.html" archiveCtx diff --git a/templates/archive.html b/templates/archive.html index 4d91f5b..e7a1c1b 100644 --- a/templates/archive.html +++ b/templates/archive.html @@ -1,2 +1,7 @@ -Posts from The Tar Pit: +

Labels

+ +

$taglist$

+ +

Posts from The Tar Pit

+ $partial("templates/post-list.html")$ -- 1.7.10.4