Initial tags implementation
This commit is contained in:
parent
110cd0f63e
commit
1c57811f1f
@ -3,9 +3,7 @@ layout: post
|
|||||||
title: "Finding a programming job"
|
title: "Finding a programming job"
|
||||||
date: 2016-03-31 17:01
|
date: 2016-03-31 17:01
|
||||||
comments: true
|
comments: true
|
||||||
categories:
|
tags: progamming, job
|
||||||
- progamming
|
|
||||||
- job
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**TL;DR** My learning from job hunting as a programmer.
|
**TL;DR** My learning from job hunting as a programmer.
|
||||||
|
8
site.hs
8
site.hs
@ -11,6 +11,8 @@ import Text.Regex (splitRegex, mkRegex)
|
|||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = hakyll $ do
|
main = hakyll $ do
|
||||||
|
tags <- extractTags
|
||||||
|
|
||||||
match "images/*" $ do
|
match "images/*" $ do
|
||||||
route idRoute
|
route idRoute
|
||||||
compile copyFileCompiler
|
compile copyFileCompiler
|
||||||
@ -56,6 +58,7 @@ main = hakyll $ do
|
|||||||
let indexCtx =
|
let indexCtx =
|
||||||
listField "posts" postCtx (return $ take 5 posts) `mappend`
|
listField "posts" postCtx (return $ take 5 posts) `mappend`
|
||||||
constField "title" "Home" `mappend`
|
constField "title" "Home" `mappend`
|
||||||
|
tagsField "tags" tags `mappend`
|
||||||
defaultContext
|
defaultContext
|
||||||
|
|
||||||
getResourceBody
|
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 :: Context String
|
||||||
postCtx =
|
postCtx =
|
||||||
dateField "date" "%B %e, %Y" `mappend`
|
dateField "date" "%B %e, %Y" `mappend`
|
||||||
|
@ -4,4 +4,9 @@
|
|||||||
<section>
|
<section>
|
||||||
$body$
|
$body$
|
||||||
</section>
|
</section>
|
||||||
|
<section>
|
||||||
|
$if(tags)$
|
||||||
|
<br>Posted in <i>$tags$</i>
|
||||||
|
$endif$
|
||||||
|
</section>
|
||||||
</article>
|
</article>
|
||||||
|
Loading…
Reference in New Issue
Block a user