Pages

Monday, 23 January 2017

搭建基于haskell的静态博客程序othercriteria-website

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

cd /usr/local
git clone https://github.com/othercriteria/website  othercriteria-website
cd othercriteria-website

root@AR:/usr/local/othercriteria-website# ls
LICENSE    Setup.hs  analytics.py  generator  root_static  website.cabal
Makefile       bootstrap       posts      stack.yaml
README.md   css       root       templates
root@AR:/usr/local/othercriteria-website# stack build
会显示:
...
Linking .stack-work/dist/i386-linux/Cabal-1.22.4.0/build/website/website ...
website-0.3.0.0: copy/register
Installing executable(s) in
/usr/local/othercriteria-website/.stack-work/install/i386-linux/lts-3.12/7.10.2/bin
Completed 123 action(s).
root@AR:/usr/local/othercriteria-website# .stack-work/dist/i386-linux/Cabal-1.22.4.0/build/website/website build
root@AR:/usr/local/othercriteria-website# ls
LICENSE    Setup.hs  analytics.py  generator  root_static  website.cabal
Makefile   _cache    bootstrap       posts      stack.yaml
README.md  _site     css       root       templates
root@AR:/usr/local/othercriteria-website# cd _site
root@AR:/usr/local/othercriteria-website/_site# ls
about.html              favicon.ico          
archive.html              fonts               robots.txt
contact.html              googledf7fba8d8e31fb41.html  stats.html
css                  index.html           trivia.html
daniel-klein-resume-2016.pdf  js
error.html              links.html
root@AR:/usr/local/othercriteria-website/_site#
(可见/usr/local/othercriteria-website/_site就是静态网站的根目录)

新建源帖:
root@AR:/usr/local/othercriteria-website/_site#  cd ..
root@AR:/usr/local/othercriteria-website# mkdir posts (/usr/local/othercriteria-website/下没有posts目录,我们在此创建它)
root@AR:/usr/local/othercriteria-website# cd posts
root@AR:/usr/local/othercriteria-website/posts# nano 2017-01-23-test-1.md
root@AR:/usr/local/othercriteria-website/posts# cat 2017-01-23-test-1.md
---
title: 测试1
---

这是测试1.

看看如何?

root@AR:/usr/local/othercriteria-website/posts# cd ..
root@AR:/usr/local/othercriteria-website# .stack-work/dist/i386-linux/Cabal-1.22.4.0/build/website/website build

演示网站:http://ocw.bright.biz.st, http://mesokurtosis.com/(程序作者的网站)
项目地址:https://github.com/othercriteria/website

No comments:

Post a Comment