Total Pageviews

Monday, 20 February 2017

搭建基于haskell的静态博客程序dr-hakyll

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

cd /usr/local
git clone https://github.com/stackbuilders/dr-hakyll  dr-hakyll-site
cd dr-hakyll-site

root@AR:/usr/local/dr-hakyll-site# stack build
会显示:
...
Linking .stack-work/dist/i386-linux/Cabal-1.22.4.0/build/dr-hakyll/dr-hakyll ...
dr-hakyll-0.1.0: copy/register
Installing executable(s) in
/usr/local/dr-hakyll-site/.stack-work/install/i386-linux/lts-3.6/7.10.2/bin
Completed 123 action(s).
root@AR:/usr/local/dr-hakyll-site#
.stack-work/dist/i386-linux/Cabal-1.22.4.0/build/dr-hakyll/dr-hakyll build
root@AR:/usr/local/dr-hakyll-site# ls
README.md  _site     app     css          index.html  stack.yaml
_cache       about.md  contact.md  dr-hakyll.cabal  posts       templates
root@AR:/usr/local/dr-hakyll-site#  cd _site

root@AR:/usr/local/dr-hakyll-site/_site# ls
about.html    atom.xml        css        posts
archive.html  contact.html  index.html    rss.xml
root@AR:/usr/local/dr-hakyll-site/_site# 

(可见 /usr/local/dr-hakyll-site/_site就是静态网站的根目录)

新建源帖:
root@AR:/usr/local/dr-hakyll-site/_site# cd .. /posts
root@AR:/usr/local/dr-hakyll-site/posts# nano 2017-02-13-test-1.md
root@AR:/usr/local/dr-hakyll-site/posts# cat 2017-02-13-test-1.md
---
title: 测试1
author: brite fisherman
---

这是测试1.

看看如何?

root@AR:/usr/local/dr-hakyll-site/posts# cd ..

root@AR:/usr/local/dr-hakyll-site# .stack-work/dist/i386-linux/Cabal-1.22.4.0/build/dr-hakyll/dr-hakyll build

演示网站:http://dh.bright.biz.st/  
项目地址: https://github.com/stackbuilders/dr-hakyll
 

No comments:

Post a Comment