~dbalan/blogng unlisted

1c57811f1f78e3113c142434915eed13e1b45d83 — Dhananjay Balan 4 years ago 110cd0f
Initial tags implementation
3 files changed, 15 insertions(+), 4 deletions(-)

M blog/2016-03-31-finding-a-programming-job.markdown
M site.hs
M templates/post.html
M blog/2016-03-31-finding-a-programming-job.markdown => blog/2016-03-31-finding-a-programming-job.markdown +1 -3
@@ 3,9 3,7 @@ layout: post
title: "Finding a programming job"
date: 2016-03-31 17:01
comments: true
categories: 
 - progamming
 - job
tags: progamming, job
---

**TL;DR** My learning from job hunting as a programmer.

M site.hs => site.hs +8 -0
@@ 11,6 11,8 @@ import           Text.Regex (splitRegex, mkRegex)
--------------------------------------------------------------------------------
main :: IO ()
main = hakyll $ do
    tags <- extractTags

    match "images/*" $ do
        route   idRoute
        compile copyFileCompiler


@@ 56,6 58,7 @@ main = hakyll $ do
            let indexCtx =
                    listField "posts" postCtx (return $ take 5 posts) `mappend`
                    constField "title" "Home"                `mappend`
                    tagsField  "tags" tags                   `mappend`
                    defaultContext

            getResourceBody


@@ 67,6 70,11 @@ main = hakyll $ do


--------------------------------------------------------------------------------
extractTags :: Rules Tags
extractTags = do
  tags <- buildTags ("blogs/**" .&&. hasNoVersion) $ fromCapture "tags/*.html"
  return $ sortTagsBy caseInsensitiveTags tags

postCtx :: Context String
postCtx =
    dateField "date" "%B %e, %Y" `mappend`

M templates/post.html => templates/post.html +6 -1
@@ 3,5 3,10 @@
    <p class="subtitle">$date$</p>
    <section>
        $body$
        </section>
    </section>
    <section>
        $if(tags)$
        <br>Posted in <i>$tags$</i>
        $endif$
    </section>
</article>