Total Pageviews

Wednesday 24 August 2016

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

先安装ghc.

cd /usr/local
git clone https://github.com/jozefg/blog jozefg.bitbucket.org
cd jozefg.bitbucket.org


root@AR:/usr/local/jozefg.bitbucket.org# ls
about.md    contact.md images      posts   Setup.hs    templates
blog.cabal  css index.html  README.md   site.hs
_cache     favicon.ico  LICENSE     resume.html  

root@AR:/usr/local/jozefg.bitbucket.org# ghc --make site.hs
root@AR:/usr/local/jozefg.bitbucket.org# ls
about.md    contact.md images      posts   Setup.hs  site.hi  templates
blog.cabal  css index.html  README.md   site     site.hs
_cache     favicon.ico  LICENSE     resume.html  site.o
root@AR:/usr/local/jozefg.bitbucket.org# ./site build
root@AR:/usr/local/jozefg.bitbucket.org# ls
about.md    contact.md images      posts   Setup.hs  site.hi  templates
blog.cabal  css index.html  README.md   site     site.hs
_cache     favicon.ico  LICENSE     resume.html  _site     site.o
(生成了_site目录)
root@AR:/usr/local/jozefg.bitbucket.org# cd _site
root@AR:/usr/local/jozefg.bitbucket.org/_site# ls
about.html    atom.xml     css images      posts   rss.xml
archive.html  contact.html  favicon.ico  index.html  resume.html  tags
root@AR:/usr/local/jozefg.bitbucket.org/_site#
(可见/usr/local/jozefg.bitbucket.org/_site/就是静态网站的根目录)

新建源贴:
root@AR:/usr/local/jozefg.bitbucket.org/_site# cd ..
root@AR:/usr/local/jozefg.bitbucket.org# cd posts
root@AR:/usr/local/jozefg.bitbucket.org/posts# nano 2016-08-24-1642-test-1.md
root@AR:/usr/local/jozefg.bitbucket.org/posts# cat 2016-08-24-1642-test-1.md
(注意:源贴的顶部的那些值里不能有":", "-"这样的标点符号。如果有,请把值用引号包起来。比如
---
title: ‘测试1-看看如何'
tags: misc1, misc2, misc3
---

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

演示网站:http://surmount.biz.st:4285,http://jfg.smt.biz.st
http://jozefg.bitbucket.org (程序作者的网站)
项目地址:https://github.com/jozefg/blog