Pages

Thursday, 2 February 2017

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



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

apt-get install agda-mode agda-stdlib -y
cd /usr/local
git clone https://github.com/bitonic/website mazzo.li
cd  mazzo.li

root@AR:/usr/local/mazzo.li#
root@AR:/usr/local/mazzo.li# stack build --install-ghc
it shows:
...
Linking .stack-work/dist/i386-linux/Cabal-1.22.4.0/build/site/site ...
website-0.0.0: copy/register
Installing executable(s) in
/usr/local/mazzo.li/.stack-work/install/i386-linux/nightly-2015-08-06/7.10.2/bin
Completed 140 action(s).
root@AR:/usr/local/mazzo.li# .stack-work/dist/i386-linux/Cabal-1.22.4.0/build/site/site build
it exports:
...
Failed to find source of module Data.Nat in any of the following
locations:
  /usr/local/mazzo.li/posts/Data/Nat.agda
  /usr/local/mazzo.li/posts/Data/Nat.lagda
  /home/bitonic/src/website/
agdalib/src/Data/Nat.agda
  /home/bitonic/src/website/agdalib/src/Data/Nat.lagda
  /usr/local/mazzo.li/.stack-work/install/i386-linux/nightly-2015-08-06/7.10.2/share/i386-linux-ghc-7.10.2/Agda-2.4.2.3/lib/prim/Data/Nat.agda
  /usr/local/mazzo.li/.stack-work/install/i386-linux/nightly-2015-08-06/7.10.2/share/i386-linux-ghc-7.10.2/Agda-2.4.2.3/lib/prim/Data/Nat.lagda
when scope checking the declaration
  open import Data.Nat using (ℕ; zero; suc; _+_; _≤?_; _≥_)
  [ERROR] ExitFailure 1
root@AR:/usr/local/mazzo.li#

解决办法:
root@AR:/usr/local/mazzo.li# cd posts
root@AR:/usr/local/mazzo.li/posts# rm AgdaSort.lagda AgdaSort.lagda.metadata Lambda.lagda Lambda.lagda.metadata
root@AR:/usr/local/mazzo.li/posts# cd ..
root@AR:/usr/local/mazzo.li# .stack-work/dist/i386-linux/Cabal-1.22.4.0/build/site/site rebuild
(会生成_site目录)
root@AR:/usr/local/mazzo.li# cd _site
root@AR:/usr/local/mazzo.li/_site# ls
archive.html  assets  atom.xml    cv  index.html    posts  rss.xml
root@AR:/usr/local/mazzo.li/_site#
(可见/usr/local/mazzo.li/_site就是静态网站的根目录)

新建源帖:
 root@AR:/usr/local/mazzo.li/_site# cd ../posts
root@AR:/usr/local/mazzo.li/posts# nano test-1.md
root@AR:/usr/local/mazzo.li/posts# cat test-1.md
---
title: 测试1
date: 2017-02-02 15:22:00
---

这是测试1.

看看如何?

root@AR:/usr/local/mazzo.li/posts# cd ..
root@AR:/usr/local/mazzo.li# .stack-work/dist/i386-linux/Cabal-1.22.4.0/build/site/site rebuild

演示网站:http://bw.bright.biz.st/,http://bw.bright.biz.st/archive.html
项目地址:https://github.com/bitonic/website
相关项目:https://github.com/bitonic/hakyll-agda

相关帖子:搭建基于haskell的静态博客程序liamoc.net

No comments:

Post a Comment