搭建基于haskell的静态博客程序aherrmann.github.io

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

cd /usr/local
git clone https://github.com/aherrmann/aherrmann.github.io.hakyll aherrmann.github.io
cd aherrmann.github.io

root@AR:/usr/local/aherrmann.github.io# stack init --solver
root@AR:/usr/local/aherrmann.github.io# stack build
会显示:
...
Linking .stack-work/dist/i386-linux/Cabal-1.24.0.0/build/blog/blog ...
                 
Warning: The following modules should be added to exposed-modules or other-modules in /usr/local/aherrmann.github.io/blog.cabal:
    - In blog component:
        Adjacent
        Highlight

Missing modules in the cabal file are likely to cause undefined reference errors from the linker, along with other problems.
blog-0.1.0.0: copy/register
Installing executable(s) in
/usr/local/aherrmann.github.io/.stack-work/install/i386-linux/lts-7.19/8.0.1/bin
Completed 113 action(s).
root@AR:/usr/local/aherrmann.github.io#  .stack-work/dist/i386-linux/Cabal-1.24.0.0/build/blog/blog build
root@AR:/usr/local/aherrmann.github.io# cd _site
root@AR:/usr/local/aherrmann.github.io/_site# ls
about.html  archive  atom.xml  contact.html  css
root@AR:/usr/local/aherrmann.github.io/_site# cd archive
root@AR:/usr/local/aherrmann.github.io/_site/archive# ls
<u>index.html</u>
root@AR:/usr/local/aherrmann.github.io/_site/archive#
(可见/usr/local/aherrmann.github.io/_site/archive就是静态网站的根目录)

新建源帖:
root@AR:/usr/local/aherrmann.github.io/_site/archive# cd ../../posts
root@AR:/usr/local/aherrmann.github.io/posts# nano 2017-02-11-test-1.md
root@AR:/usr/local/aherrmann.github.io/posts# cat 2017-02-11-test-1.md
---
title: 测试1
category: programming
tags: misc1, misc2, misc3
---

这是测试1.

看看如何?


root@AR:/usr/local/aherrmann.github.io/posts# cd ..

root@AR:/usr/local/aherrmann.github.io# .stack-work/dist/i386-linux/Cabal-1.24.0.0/build/blog/blog rebuild

 

演示网站:http://agi.bright.biz.st

项目地址:https://github.com/aherrmann/aherrmann.github.io.hakyll