Total Pageviews

Monday 30 January 2017

搭建基于haskell的静态博客程序an-pro.org


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

cd /usr/local
git clone https://github.com/swamp-agr/an-pro.org
cd  an-pro.org

root@AR:/usr/local/an-pro.org# ghc --make site.hs
root@AR:/usr/local/an-pro.org# ./site build
root@AR:/usr/local/an-pro.org# cd _site
root@AR:/usr/local/an-pro.org/_site# ls
about.html  contact.html  css  feed.xml  img  index.html  js   tags
root@AR:/usr/local/an-pro.org/_site#
(可见 /usr/local/an-pro.org/_site目录就是静态网站的根目录)


新建源帖:
 root@AR:/usr/local/an-pro.org/_site# cd ..
  root@AR:/usr/local/an-pro.org# mkdir posts (当前目录下没有posts目录,于是创建之)
root@AR:/usr/local/an-pro.org# cd posts
root@AR:/usr/local/an-pro.org/posts# nano 2017-01-30-test-1.md
root@AR:/usr/local/an-pro.org/posts# cat 2017-01-30-test-1.md
---
title: 测试1
image: xyz
tags: misc1, misc2, misc3
---

这是测试1.

看看如何?

root@AR:/usr/local/an-pro.org/posts# cd ..
root@AR:/usr/local/an-pro.org# ./site rebuild

演示网站:http://apo.bright.biz.st
项目地址:https://github.com/swamp-agr/an-pro.org

No comments:

Post a Comment