先搭建ghc环境。
cd /usr/local
git clone https://github.com/regisfoucault/blog regisfoucault-blog
cd regisfoucault-blog
cd /usr/local
git clone https://github.com/regisfoucault/blog regisfoucault-blog
cd regisfoucault-blog
root@AR:/usr/local/regisfoucault-blog# ls
_cache data Makefile templates
css index.html posts site.hs
root@AR:/usr/local/regisfoucault-blog# ghc --make site.hs
root@AR:/usr/local/regisfoucault-blog# ls
_cache data Makefile site site.hi site.o
css index.html posts site.hs templates
root@AR:/usr/local/regisfoucault-blog# ./site build
root@AR:/usr/local/regisfoucault-blog# ls
_cache data Makefile site site.hi site.o
css index.html posts _site site.hs templates
(生成了_site目录)
root@AR:/usr/local/regisfoucault-blog# cd _site
root@AR:/usr/local/regisfoucault-blog/_site# ls
css index.html posts robots.txt
root@AR:/usr/local/regisfoucault-blog/_site#
(可见/usr/local/regisfoucault-blog/_site/就是静态网站的根目录)
新建源贴:
root@AR:/usr/local/regisfoucault-blog/_site# cd ..
root@AR:/usr/local/regisfoucault-blog# ls
_cache data Makefile site site.hi site.o
css index.html posts _site site.hs templates
root@AR:/usr/local/regisfoucault-blog# cd posts
root@AR:/usr/local/regisfoucault-blog/posts# nano 2016-08-19-1903-test-1.md
root@AR:/usr/local/regisfoucault-blog/posts# cat 2016-08-19-1903-test-1.md
---
title: 测试1
twittertext: "测试1"
---
这是测试1.
root@AR:/usr/local/regisfoucault-blog/posts# cd ..
root@AR:/usr/local/regisfoucault-blog# ./site build
演示网站:http://rf.smt.biz.st
项目地址:https://github.com/regisfoucault/blog