Total Pageviews

Wednesday, 16 November 2016

搭建基于hakyll的静态博客程序AXIOMATIC-SEMANTICS

先按此文http://briteming.blogspot.com/2016/07/hakyll.html,搭建stack,ghc,hakyll.

cd /usr/local
git clone https://github.com/Libbum/AxiomaticSemantics AxiomaticSemantics-site
cd AxiomaticSemantics-site

root@AR:/usr/local/AxiomaticSemantics-site# ghc --make site.hs
[1 of 3] Compiling Includes.Pandoc ( Includes/Pandoc.hs, Includes/Pandoc.o )
Includes/Pandoc.hs:8:1: error:
Ambiguous interface for ‘Crypto.Hash’:
it was found in multiple packages:
cryptohash-0.11.9 cryptonite-0.20
root@AR:/usr/local/AxiomaticSemantics-site#
遇到如上错误的解决办法:
root@AR:/usr/local/AxiomaticSemantics-site# ghc-pkg hide cryptonite-0.20
(参见https://github.com/Libbum/AxiomaticSemantics/issues/5,我搭建基于hakyll的静态博客程序时,经常遇错,如果程序作者不回复我的问题,这类问题是很难解决的,所以搭建基于hakyll的静态博客程序有时是很磨人的。)
root@AR:/usr/local/AxiomaticSemantics-site# ghc --make site.hs 
(这次不再遇错,在当前目录下,生成了可执行文件site)
root@AR:/usr/local/AxiomaticSemantics-site# ./site build
root@AR:/usr/local/AxiomaticSemantics-site# ls
about.markdown error     index.html  README.md   site.hi
assets favicon.ico  js robots.txt  site.hs
_cache images     Makefile site     site.o
css Includes     posts _site     templates
root@AR:/usr/local/AxiomaticSemantics-site# cd _site
root@AR:/usr/local/AxiomaticSemantics-site/_site# ls
about.html    atom.xml favicon.ico  js   robots.txt
archive.html  css images     papers.html  tags
assets       error index.html   posts
root@AR:/usr/local/AxiomaticSemantics-site/_site# 
(可见/usr/local/AxiomaticSemantics-site/_site就是静态网站的根目录)

新建源帖:
root@AR:/usr/local/AxiomaticSemantics-site/_site# cd ../posts
root@AR:/usr/local/AxiomaticSemantics-site/posts# nano 2016-11-15-test-1.markdown
root@AR:/usr/local/AxiomaticSemantics-site/posts# cat 2016-11-15-test-1.markdown
---
title: 测试1
byline: abc
tags: misc1, misc2, misc3
---

这是测试1.

看看如何?
root@AR:/usr/local/AxiomaticSemantics-site/posts# cd ..
root@AR:/usr/local/AxiomaticSemantics-site# ./site build

演示网站:http://as.bright.biz.st/
项目地址:https://github.com/Libbum/AxiomaticSemantics
https://github.com/Libbum/AxiomaticSemantics/issues/5