Total Pageviews

Saturday 20 August 2016

搭建基于hakyll的静态博客程序workforpizza

cd /usr/local/
git clone https://github.com/irneh/workforpizza workforpizza-site
cd workforpizza-site

root@AR:/usr/local/workforpizza-site# ls
404.html  files   index.html  rebuild.sh  templates
_cache   henri   posts       site.hs  tmp
css   images  README.md  todo.asc

root@AR:/usr/local/workforpizza-site# ghc --make site.hs
root@AR:/usr/local/workforpizza-site# ls
404.html  files   index.html  rebuild.sh  site.hi  templates
_cache   henri   posts       site   site.hs  tmp
css   images  README.md   site.o   todo.asc
root@AR:/usr/local/workforpizza-site# ./site build (此为生成/更新静态网站的命令)
root@AR:/usr/local/workforpizza-site# ls
404.html  files   index.html  rebuild.sh  site.hi  templates
_cache   henri   posts       site   site.hs  tmp
css   images  README.md   _site   site.o   todo.asc
(生成了_site目录)
root@AR:/usr/local/workforpizza-site# cd _site
root@AR:/usr/local/workforpizza-site/_site# ls
404.html  css  files  henri  images  index.html  posts
root@AR:/usr/local/workforpizza-site/_site# 
(可见,/usr/local/workforpizza-site/_site/就是静态网站的根目录)

新建源贴:
root@AR:/usr/local/workforpizza-site/_site# cd ..
root@AR:/usr/local/workforpizza-site# 
root@AR:/usr/local/workforpizza-site# cd posts 
root@AR:/usr/local/workforpizza-site/posts# nano 2016-08-19-1802-test-1.md
root@AR:/usr/local/workforpizza-site/posts# cat 2016-08-19-1802-test-1.md
---
title: 测试1
author: brite
---

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

演示网站:http://wfp.smt.biz.st
项目地址:https://github.com/irneh/workforpizza