~jack/jackkelly-name

ref: 8de6f1521045b2fbc086cb30d9fc901d7170ab5a jackkelly-name/src/Blog/Util.hs -rw-r--r-- 506 bytes
8de6f152Jack Kelly Import site code from unified repo 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module Blog.Util (baseBlogContext, parseBlogDate) where

import Data.Time (Day, defaultTimeLocale, iso8601DateFormat, parseTimeOrError)
import Hakyll
import Navigation (navigation, navigationContext, select)
import Site (baseSiteContext)

baseBlogContext :: Context String
baseBlogContext =
  navigationContext (select "Blog" navigation) <> baseSiteContext

parseBlogDate :: String -> Day
parseBlogDate = parseTimeOrError False defaultTimeLocale format where
  format = iso8601DateFormat $ Just "%H:%M:%S"