Total Pageviews

Tuesday, 23 August 2016

搭建基于hakyll的静态博客程序xoltar.org

先安装ghc.

cd /usr/local
git clone https://github.com/xoltar/xoltar.org
cd xoltar.org

root@AR:/usr/local/xoltar.org# ls
about.rst   css       LICENSE site.hs     templates
_cache   images      posts xoltar-org.cabal
contact.markdown  index.html  Setup.hs stack.yaml

root@AR:/usr/local/xoltar.org# ghc --make site.hs
root@AR:/usr/local/xoltar.org# ls
about.rst   css       LICENSE site site.hs     templates
_cache   images      posts site.o   xoltar-org.cabal
contact.markdown  index.html  Setup.hs site.hi  stack.yaml
root@AR:/usr/local/xoltar.org# ./site build
root@AR:/usr/local/xoltar.org# ls
about.rst   css       LICENSE site site.hs     templates
_cache   images      posts _site site.o      xoltar-org.cabal
contact.markdown  index.html  Setup.hs site.hi  stack.yaml
root@AR:/usr/local/xoltar.org# cd _site
root@AR:/usr/local/xoltar.org/_site# ls
about  archive atom.xml  contact  css images index.html  posts  rss.xml
root@AR:/usr/local/xoltar.org/_site#
(可见/usr/local/xoltar.org/_site/就是静态网站的根目录)

新建源贴:
root@AR:/usr/local/xoltar.org/_site# cd ../posts
root@AR:/usr/local/xoltar.org/posts# nano 2016-08-23-1004-test-1.markdown
root@AR:/usr/local/xoltar.org/posts# cat 2016-08-23-1004-test-1.markdown
---
title: 测试1
---

这是测试1.
root@AR:/usr/local/xoltar.org/posts# cd ..
root@AR:/usr/local/xoltar.org# ./site build

演示网站:http://xt.smt.biz.st
项目地址:https://github.com/xoltar/xoltar.org