import System.Directory import Data.Either import Data.List import System.Environment (getArgs) import System.Process (readProcess) import Files import Heckle main = do args <- getArgs case args of ["build"] -> do putStrLn "Reading directory and turning into native posts" postsToBeCreated <- mapM fileToPost =<< (getDirectoryContents "posts") let posts = (reverse . sort . rights) (postsToBeCreated) putStrLn ("Number of posts found: " ++ (show (length posts))) putStrLn "Writing markdown files into template HTML" template <- readFile "template.html.hkl" mapM_ (writeHTML template) posts putStrLn "Creating HTML