先按此文http://briteming.blogspot.jp/2016/07/hakyll.html,安装stack和ghc.
cd /usr/local
git clone https://github.com/i1brnkv/i1brnkv.github.io
cd i1brnkv.github.io
root@AR:/usr/local/i1brnkv.github.io# ls
about.html contact.html images posts yandex_60d5d7d92dc7f1bf.html
archive.html css index.html src
root@AR:/usr/local/i1brnkv.github.io# cd src
root@AR:/usr/local/i1brnkv.github.io/src# ls
about.md css index.html site.hs templates
contact.md images posts
root@AR:/usr/local/i1brnkv.github.io/src# ghc --make site.hs
root@AR:/usr/local/i1brnkv.github.io/src# ls
about.md css index.html site site.hs templates
contact.md images posts site.hi site.o
(生成了可执行文件site)
root@AR:/usr/local/i1brnkv.github.io/src# ./site rebuild (这个就是生成/更新静态网站的根目录的命令)
root@AR:/usr/local/i1brnkv.github.io/src# ls
_cache about.md css index.html site site.hs templates
_site contact.md images posts site.hi site.o
(生成了_site目录)
root@AR:/usr/local/i1brnkv.github.io/src# cd _site
root@AR:/usr/local/i1brnkv.github.io/src/_site# ls
about.html archive.html contact.html posts
root@AR:/usr/local/i1brnkv.github.io/src/_site#
(/usr/local/i1brnkv.github.io/src/_site/里面没有index.html文件,我们可以把archive.html 重命名为index.html,这样/usr/local/i1brnkv.github.io/src/_site就是静态网站的根目录。)
新建源帖:
root@AR:/usr/local/i1brnkv.github.io/src/_site# cd ../posts
root@AR:/usr/local/i1brnkv.github.io/src/posts# nano 2016-01-06-test-1.md
root@AR:/usr/local/i1brnkv.github.io/src/posts# cat 2016-01-06-test-1.md
---
title: 测试1
tags: misc1, misc2, misc3
---
这是测试1.
看看如何?
root@AR:/usr/local/i1brnkv.github.io/src/posts# cd ..
root@AR:/usr/local/i1brnkv.github.io/src# ./site rebuild
会显示:
...
[ERROR] Hakyll.Core.UnixFilter.unixFilterWith: runghc gave exit code 1
root@AR:/usr/local/i1brnkv.github.io/src# cd _site
root@AR:/usr/local/i1brnkv.github.io/src/_site# ls
about.html archive.html contact.html posts
root@AR:/usr/local/i1brnkv.github.io/src/_site# mv archive.html index.html
root@AR:/usr/local/i1brnkv.github.io/src/_site# cp -rf /usr/local/i1brnkv.github.io/css/ ./
(注意:发完新帖后,不要忘记运行上面的2步)
演示网站:http://igi.bright.biz.st
项目地址:https://github.com/i1brnkv/i1brnkv.github.io
cd /usr/local
git clone https://github.com/i1brnkv/i1brnkv.github.io
cd i1brnkv.github.io
root@AR:/usr/local/i1brnkv.github.io# ls
about.html contact.html images posts yandex_60d5d7d92dc7f1bf.html
archive.html css index.html src
root@AR:/usr/local/i1brnkv.github.io# cd src
root@AR:/usr/local/i1brnkv.github.io/src# ls
about.md css index.html site.hs templates
contact.md images posts
root@AR:/usr/local/i1brnkv.github.io/src# ghc --make site.hs
root@AR:/usr/local/i1brnkv.github.io/src# ls
about.md css index.html site site.hs templates
contact.md images posts site.hi site.o
(生成了可执行文件site)
root@AR:/usr/local/i1brnkv.github.io/src# ./site rebuild (这个就是生成/更新静态网站的根目录的命令)
root@AR:/usr/local/i1brnkv.github.io/src# ls
_cache about.md css index.html site site.hs templates
_site contact.md images posts site.hi site.o
(生成了_site目录)
root@AR:/usr/local/i1brnkv.github.io/src# cd _site
root@AR:/usr/local/i1brnkv.github.io/src/_site# ls
about.html archive.html contact.html posts
root@AR:/usr/local/i1brnkv.github.io/src/_site#
(/usr/local/i1brnkv.github.io/src/_site/里面没有index.html文件,我们可以把archive.html 重命名为index.html,这样/usr/local/i1brnkv.github.io/src/_site就是静态网站的根目录。)
新建源帖:
root@AR:/usr/local/i1brnkv.github.io/src/_site# cd ../posts
root@AR:/usr/local/i1brnkv.github.io/src/posts# nano 2016-01-06-test-1.md
root@AR:/usr/local/i1brnkv.github.io/src/posts# cat 2016-01-06-test-1.md
---
title: 测试1
tags: misc1, misc2, misc3
---
这是测试1.
看看如何?
root@AR:/usr/local/i1brnkv.github.io/src/posts# cd ..
root@AR:/usr/local/i1brnkv.github.io/src# ./site rebuild
会显示:
...
[ERROR] Hakyll.Core.UnixFilter.unixFilterWith: runghc gave exit code 1
root@AR:/usr/local/i1brnkv.github.io/src# cd _site
root@AR:/usr/local/i1brnkv.github.io/src/_site# ls
about.html archive.html contact.html posts
root@AR:/usr/local/i1brnkv.github.io/src/_site# mv archive.html index.html
root@AR:/usr/local/i1brnkv.github.io/src/_site# cp -rf /usr/local/i1brnkv.github.io/css/ ./
(注意:发完新帖后,不要忘记运行上面的2步)
演示网站:http://igi.bright.biz.st
项目地址:https://github.com/i1brnkv/i1brnkv.github.io