Total Pageviews

Sunday, 29 January 2017

搭建基于haskell的静态博客程序evbogue

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

cd /usr/local
git clone -b gb https://gitlab.com/ev/evbogue evbogue-site-gb-branch
cd evbogue-site-gb-branch

root@AR:/usr/local/evbogue-site-gb-branch# ghc --make site.hs
root@AR:/usr/local/evbogue-site-gb-branch# ./site build
root@AR:/usr/local/evbogue-site-gb-branch# cd _site
root@AR:/usr/local/evbogue-site-gb-branch/_site#
( /usr/local/evbogue-site-gb-branch/_site/里面有index.html,所以/usr/local/evbogue-site-gb-branch/_site目录就是静态网站的根目录)

新建源帖:
 root@AR:/usr/local/evbogue-site-gb-branch/_site# cd ../posts
root@AR:/usr/local/evbogue-site-gb-branch/posts# nano 2017-01-08-test-1.md
root@AR:/usr/local/evbogue-site-gb-branch/posts# cat 2017-01-08-test-1.md
---
title: 测试1
date: 2017-01-08
---

这是测试1.

看看如何?

root@AR:/usr/local/evbogue-site-gb-branch/posts#
(注:帖子的文件名里面不写出2017-01-08也行,比如写成xyz.md也行,不过date的值最好加上15:23:20,即,xyz.md的内容为:
---
title: 测试xyz
date: 2017-01-30 15:40:00
---

这是测试xyz.


看看如何?)
root@AR:/usr/local/evbogue-site-gb-branch/posts# cd ..
root@AR:/usr/local/evbogue-site-gb-branch# ./site rebuild

演示网站:http://evb.bright.biz.st
项目地址:https://gitlab.com/ev/evbogue/tree/gb

No comments:

Post a Comment