Total Pageviews

Wednesday, 11 January 2017

搭建基于haskell的静态博客程序arknave-blog

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

cd /usr/local
git clone https://github.com/arknave/blog  arknave-blog
cd arknave-blog

root@AR:/usr/local/arknave-blog# ls
CNAME    css         humans.txt  posts    
about.md  deploy.sh  index.html  site.hs  templates
root@AR:/usr/local/arknave-blog# ghc --make site.hs
root@AR:/usr/local/arknave-blog# ls
CNAME    css         humans.txt  posts    site.hi  site.o
about.md  deploy.sh  index.html  site    site.hs  templates
(生成了可执行文件site)
root@AR:/usr/local/arknave-blog# ./site build (此即生成/更新静态网站的根目录的命令)
root@AR:/usr/local/arknave-blog# ls
CNAME    _site      css         humans.txt  posts    site.hi  site.o
_cache    about.md  deploy.sh  index.html  site    site.hs  templates
(生成了_site目录)
root@AR:/usr/local/arknave-blog# cd _site
root@AR:/usr/local/arknave-blog/_site# ls
CNAME  about.html  archive.html  css  humans.txt  index.html  posts
root@AR:/usr/local/arknave-blog/_site#
(可见/usr/local/arknave-blog/_site就是静态网站的根目录)

新建源帖:
root@AR:/usr/local/arknave-blog/_site# cd ../posts
root@AR:/usr/local/arknave-blog/posts# nano 2017-01-11-test-1.md
root@AR:/usr/local/arknave-blog/posts# cat 2017-01-11-test-1.md
---
title: 测试1
---

这是测试1.

看看如何?

root@AR:/usr/local/arknave-blog/posts# cd ..
root@AR:/usr/local/arknave-blog# ./site build

演示网站:http://anb.bright.biz.st/
项目地址:https://github.com/arknave/blog

No comments:

Post a Comment