hakyll

5
Hakyllのススメ 三島Haskell無名関数の会#2 @kzfm

Upload: kazufumi-ohkawa

Post on 10-May-2015

1.184 views

Category:

Documents


1 download

TRANSCRIPT

Hakyllのススメ

三島Haskell無名関数の会#2 @kzfm

Hakyll

•  Haskell製の静的サイトジェネレーター – pandocでフォーマット変換 – unixFilterで任意の外部コマンドが使える •  sassとかjadeとかstylusとか

•  GithubPagesとも相性が良い – deployとかラクチン

install Hakyll

$ mkvhenv hakyll # make virtualenv for hakyll $ cabal install hakyll

# download shizuru-site$ git clone https://github.com/shizuru/shizuru.github.com.git

# edit site.hs$ ghc –-make site.hs$ ./site build # build site$ ./site server # check site$ ./site deploy # deploy site

設定の書き方

main :: IO ()main = hakyllWith config $ do match "images/*" $ do route idRoute compile copyFileCompiler

match "css/*" $ do route idRoute compile compressCssCompiler

match "templates/*" $ compile templateCompiler

match "bootstrap/bootstrap/**" $ do route $ gsubRoute "bootstrap/bootstrap/" (const "") compile copyFileCompiler

マッチさせて、出力先を決めて、コンパイルする

今日の目標 •  shizuru.github.com – ブログのように新しいエントリーをコミットしたらきちんと表示できるようにする

– メンバーの一覧をハードコードしないでjsのGithubAPIを利用して表示させる

– スライドのリンクも用意したい