Total Pageviews

Monday, 22 August 2016

搭建基于hakyll的静态博客程序reichertbrothers.com

首先安装ghc.

cd /usr/local/
git clone https://github.com/rbros/reichertbrothers.com
cd reichertbrothers.com

root@AR:/usr/local/reichertbrothers.com# ls
about.markdown   index.html   talks
blog   js   talks.markdown
_cache   portfolio.markdown   templates
contact.markdown  reichertbrothers.cabal  site.hs
css   scripts   stack.yaml
images   services.markdown   

root@AR:/usr/local/reichertbrothers.com# ghc --make site.hs
root@AR:/usr/local/reichertbrothers.com# ls
about.markdown   index.html   site       talks
blog   js   talks.markdown
_cache   portfolio.markdown   site.hi     templates
contact.markdown  reichertbrothers.cabal  site.hs
css   scripts   site.o
images   services.markdown   stack.yaml
root@AR:/usr/local/reichertbrothers.com# ./site build
root@AR:/usr/local/reichertbrothers.com# ls
about.markdown   index.html   site       talks
blog   js   _site       talks.markdown
_cache   portfolio.markdown   site.hi     templates
contact.markdown  reichertbrothers.cabal  site.hs
css   scripts   site.o
images   services.markdown   stack.yaml

root@AR:/usr/local/reichertbrothers.com# cd _site
root@AR:/usr/local/reichertbrothers.com/_site# ls
about.html  blog.html   images      portfolio.html  talks.html
atom.xml    contact.html  index.html  services.html
blog     css   js       tags
root@AR:/usr/local/reichertbrothers.com/_site# 
(可见/usr/local/reichertbrothers.com/_site/就是静态网站的根目录)

新建源贴:
root@AR:/usr/local/reichertbrothers.com/_site# cd ..
root@AR:/usr/local/reichertbrothers.com# ls
about.markdown   index.html   site       talks
blog   js   _site       talks.markdown
_cache   portfolio.markdown   site.hi     templates
contact.markdown  reichertbrothers.cabal  site.hs
css   scripts   site.o
images   services.markdown   stack.yaml
root@AR:/usr/local/reichertbrothers.com# cd blog
root@AR:/usr/local/reichertbrothers.com/blog# ls
posts
root@AR:/usr/local/reichertbrothers.com/blog# cd posts
root@AR:/usr/local/reichertbrothers.com/blog/posts# nano 2016-08-22-1640-test-2.md 
root@AR:/usr/local/reichertbrothers.com/blog/posts# cat 2016-08-22-1640-test-2.md
---
title: 测试2
author: brite fisher
tags: misc1, misc2, misc3
---

这是测试2.
root@AR:/usr/local/reichertbrothers.com/blog/posts# cd ../..
root@AR:/usr/local/reichertbrothers.com# ./site build

演示网站:http://rb.smt.biz.st
项目地址:https://github.com/rbros/reichertbrothers.com