Total Pageviews

Friday 14 October 2016

搭建基于hakyll的静态博客程序-michaelxavier.net

先按此文http://briteming.blogspot.com/2016/07/hakyll.html的蓝色字部分安装stack.


cd /usr/local
git clone https://github.com/michaelxavier/michaelxavier.net
cd michaelxavier.net

root@AR:/usr/local/michaelxavier.net# ls
assets images     mxnet.cabal  posts   templates
index.html   mxnet.hs   README.markdown  stack.yaml
css javascripts  pages   Setup.hs   staged_posts

root@AR:/usr/local/michaelxavier.net# stack build
会显示:
...
Linking .stack-work/dist/i386-linux/Cabal-1.22.5.0/build/mxnet/mxnet ...
mxnet-0.1.0.0: copy/register
Installing executable(s) in
/usr/local/michaelxavier.net/.stack-work/install/i386-linux/lts-5.17/7.10.3/bin
...
root@AR:/usr/local/michaelxavier.net# .stack-work/dist/i386-linux/Cabal-1.22.5.0/build/mxnet/mxnet build (此命令就是生成静态网站的根目录的命令)
root@AR:/usr/local/michaelxavier.net# ls
assets images     mxnet.cabal  posts   _site templates
_cache index.html   mxnet.hs   README.markdown  stack.yaml
css javascripts  pages   Setup.hs   staged_posts
root@AR:/usr/local/michaelxavier.net# cd _site
root@AR:/usr/local/michaelxavier.net/_site# ls
css  images  index.html  javascripts  pages  posts  posts.html rss.xml
root@AR:/usr/local/michaelxavier.net/_site#
(可见/usr/local/michaelxavier.net/_site目录就是静态网站的根目录)

新建源贴:
root@AR:/usr/local/michaelxavier.net/_site# cd ../posts
root@AR:/usr/local/michaelxavier.net/posts# nano 2016-10-14-test-1.markdown
root@AR:/usr/local/michaelxavier.net/posts# cat 2016-10-14-test-1.markdown
---
title: 测试1
---

这是测试1.
root@AR:/usr/local/michaelxavier.net/posts# cd ..
root@AR:/usr/local/michaelxavier.net# .stack-work/dist/i386-linux/Cabal-1.22.5.0/build/mxnet/mxnet build

演示网站:http://mx.bright.biz.st/
项目地址:https://github.com/michaelxavier/michaelxavier.net