Total Pageviews

Friday, 21 October 2016

搭建基于hakyll的静态博客程序listx_blog

首先按此文http://briteming.blogspot.com/2016/07/haskellghc.html,安装ghc和cabal.
按此文http://briteming.blogspot.com/2016/07/hakyll.html,安装hakyll.
然后,
cabal update
cabal install clay
(参见http://fvisser.nl/clay/)
cd /usr/local
git clone https://github.com/listx/listx_blog funloop.org
cd funloop.org
ghc --make blog.hs (此命令会在当前目录下,生成可执行文件blog)

root@AR:/usr/local/funloop.org# ls
about.md    _cache file post
art.md    CNAME img  README.md
blog    code LICENSE  
blog.cabal  code.md lightpaperfibers_JorgeFuentes.png  sync.sh
blog.hi     css Makefile   template
blog.hs     favicon.png  misc.js xv_lasma.png
blog.o    favicon.xcf  papers.md
root@AR:/usr/local/funloop.org# ./blog build (此即为生成静态网站的根目录的命令)
root@AR:/usr/local/funloop.org# ls
about.md    _cache file     post
art.md     CNAME img     README.md
blog     code LICENSE     _site
blog.cabal  code.md lightpaperfibers_JorgeFuentes.png  sync.sh
blog.hi     css Makefile     template
blog.hs     favicon.png  misc.js     xv_lasma.png
blog.o     favicon.xcf  papers.md

root@AR:/usr/local/funloop.org# cd _site
root@AR:/usr/local/funloop.org/_site# ls
about.html    code   img       post
archive.html  code.html    index.html       tag
art.html      css   lightpaperfibers_JorgeFuentes.png  xv_lasma.png
atom.xml      favicon.png  misc.js
CNAME       file   papers.html
root@AR:/usr/local/funloop.org/_site#
(可见/usr/local/funloop.org/_site就是静态网站的根目录)

新建源贴:
root@AR:/usr/local/funloop.org/_site# cd ..
root@AR:/usr/local/funloop.org# cd post
root@AR:/usr/local/funloop.org/post# nano 2016-10-21-test-1.md
root@AR:/usr/local/funloop.org/post# cat 2016-10-21-test-1.md
---
title: "测试1"
tags: misc1, misc2, misc3
mathjax: on
---

这是测试1.
root@AR:/usr/local/funloop.org/post# cd ..
root@AR:/usr/local/funloop.org# ./blog build

演示网站:http://lb.bright.biz.st, http://bright.biz.st:5426/
http://funloop.org(程序作者的网站)
项目地址:https://github.com/listx/listx_blog