forked from manpages/blog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblog.hs
32 lines (24 loc) · 771 Bytes
/
blog.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import Data.Map (fromList)
import Data.Text (pack)
import Data.Time.Format
import System.Environment (getArgs)
import Blog
cc :: TextText
cc = fromList [ ("Cmd", "ssh -p 21984")
, ("Remote", "memorici.de")
, ("Path", "github/lue") ]
bb :: TextTexts
bb = fromList [ ("BlogCat", ["draft", "ru", "life", "tech"]) ]
ff :: PathGenerator t
ff "tech" = defaultPathFn "universe"
ff x = defaultPathFn x
cfg :: BlogCfg
cfg = BlogCfg { connection = cc, blog_spec = bb, pathFn = ff }
main :: IO ()
main = do
args <- getArgs
let [file, cat] = map pack args
ok <- post cfg file cat
putStrLn $ show ok