Total Pageviews

Saturday 28 January 2017

搭建基于haskell的静态博客程序AidanDelaney-Blog

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

cd /usr/local
git clone https://github.com/AidanDelaney/Blog www.phoric.eu
cd www.phoric.eu

root@AR:/usr/local/www.phoric.eu# stack init --solver
root@AR:/usr/local/www.phoric.eu# stack build
it shows:
...
Linking .stack-work/dist/i386-linux/Cabal-1.18.1.5/build/Blog/Blog ...
...(这里是一些无关紧要的错误)              
root@AR:/usr/local/www.phoric.eu# .stack-work/dist/i386-linux/Cabal-1.18.1.5/build/Blog/Blog build (此即生成/更新静态网站的根目录的命令.会在当前目录下生成_site目录)
root@AR:/usr/local/www.phoric.eu# cd _site
root@AR:/usr/local/www.phoric.eu/_site# ls
about.html  archive.html  contact.html    css  images  index.html  posts
root@AR:/usr/local/www.phoric.eu/_site#
(可见/usr/local/www.phoric.eu/_site就是静态网站的根目录)

新建源帖:
root@AR:/usr/local/www.phoric.eu/_site# cd ../posts
root@AR:/usr/local/www.phoric.eu/posts# nano 2017-01-28-test-2.md
root@AR:/usr/local/www.phoric.eu/posts# cat 2017-01-28-test-2.md
---
title: 测试2
---

# 测试2

这是测试2.

看看如何?

root@AR:/usr/local/www.phoric.eu/posts# cat 2017-01-28-test-1.md
# 测试1

这是测试1.

看看如何?

(上面 2017-01-28-test-2.md的格式好过2017-01-28-test-1.md的格式)
root@AR:/usr/local/www.phoric.eu/posts# cd ..
root@AR:/usr/local/www.phoric.eu# .stack-work/dist/i386-linux/Cabal-1.18.1.5/build/Blog/Blog build

演示网站:http://adb.bright.biz.st/
项目地址:https://github.com/AidanDelaney/Blog

No comments:

Post a Comment