Pages

Wednesday, 4 January 2017

搭建基于hakyll的静态网站程序datura-corsets

先按此文http://briteming.blogspot.jp/2016/07/hakyll.html,安装stack和ghc.

cd /usr/local
git clone https://github.com/dsferruzza/datura-corsets datura-corsets-site
cd datura-corsets-site

root@AR:/usr/local/datura-corsets-site# ls
articles     convert.exe       fonts    pages     site.hs
build.bat    css           images   README.md     stack.yaml
_cache         datura-corsets.cabal  js        rebuild.bat  templates
compile.bat  favicon.ico       LICENSE 
root@AR:/usr/local/datura-corsets-site# stack build
会显示:
...
Linking .stack-work/dist/i386-linux/Cabal-1.22.5.0/build/datura-corsets/datura-corsets ...
 datura-corsets-1.0.0: copy/register
 Installing executable(s) in
 /usr/local/datura-corsets-site/.stack-work/install/i386-linux/lts-6.4/7.10.3/bin
 Completed 36 action(s).
root@AR:/usr/local/datura-corsets-site# .stack-work/dist/i386-linux/Cabal-1.22.5.0/build/datura-corsets/datura-corsets build (此即生成/更新静态网站的根目录的命令)
root@AR:/usr/local/datura-corsets-site# ls
articles     convert.exe       fonts    pages     site.hs
build.bat    css           images   README.md     stack.yaml
_cache         datura-corsets.cabal  js        rebuild.bat  templates
compile.bat  favicon.ico       LICENSE  _site
root@AR:/usr/local/datura-corsets-site#
(生成了_site目录)
root@AR:/usr/local/datura-corsets-site# cd _site
root@AR:/usr/local/datura-corsets-site/_site# ls
abthese-chinese-are-killing-themselves    images
achinese-economy            index.html
awhat-Trump-Represents-is-not-crazy    js
bcoz-i-love-u                states-chinese-students-love-most
css                    favicon.ico               fonts                    galerie
root@AR:/usr/local/datura-corsets-site/_site#
(可见/usr/local/datura-corsets-site/_site就是静态网站的根目录)

新建源帖:
root@AR:/usr/local/datura-corsets-site/_site#  cd ..
root@AR:/usr/local/datura-corsets-site# mkdir pages
root@AR:/usr/local/datura-corsets-site# nano pages/index.md
root@AR:/usr/local/datura-corsets-site# cat pages/index.md
---
title: this is homepage
---

欢迎访问我的文章:http://dc.bright.biz.st/galerie
root@AR:/usr/local/datura-corsets-site#
root@AR:/usr/local/datura-corsets-site# mkdir articles
root@AR:/usr/local/datura-corsets-site# cd articles
root@AR:/usr/local/datura-corsets-site/articles# mkdir test-1
root@AR:/usr/local/datura-corsets-site/articles# cd test-1
root@AR:/usr/local/datura-corsets-site/articles/test-1# nano index.md
root@AR:/usr/local/datura-corsets-site/articles/test-1# cat index.md
---
title: 测试1
tags: misc
date: 2016-12-24 00:00:00
---

这是测试1.

root@AR:/usr/local/datura-corsets-site/articles/test-1# cd ../..
root@AR:/usr/local/datura-corsets-site# .stack-work/dist/i386-linux/Cabal-1.22.5.0/build/datura-corsets/datura-corsets build

演示网站:http://dc.bright.biz.st/galerie/
项目地址:https://github.com/dsferruzza/datura-corsets
https://github.com/dsferruzza/datura-corsets/issues/1