Total Pageviews

Wednesday 21 December 2016

搭建基于haskell的静态博客程序david.sferruzza.fr

先按此文http://briteming.blogspot.com/2016/07/hakyll.html安装stack和ghc.

cd /usr/local
git clone https://github.com/dsferruzza/david.sferruzza.fr
cd david.sferruzza.fr

root@AR:/usr/local/david.sferruzza.fr# ls
assets    david-sferruzza-fr.cabal  pages  README.md  site.hs    templates
LICENSE              posts  stack.yaml
root@AR:/usr/local/david.sferruzza.fr#  stack build
会显示:
...
Linking .stack-work/dist/i386-linux/Cabal-1.22.5.0/build/david-sferruzza-fr/david-sferruzza-fr ...
david-sferruzza-fr-1.0.0: copy/register
Installing executable(s) in
/usr/local/david.sferruzza.fr/.stack-work/install/i386-linux/lts-5.15/7.10.3/bin
Completed 122 action(s).
root@AR:/usr/local/david.sferruzza.fr# .stack-work/dist/i386-linux/Cabal-1.22.5.0/build/david-sferruzza-fr/david-sferruzza-fr build (此即生成/更新静态网站的根目录的命令)
root@AR:/usr/local/david.sferruzza.fr# ls
assets    david-sferruzza-fr.cabal  pages  README.md  site.hs    templates
_cache    LICENSE              posts  _site        stack.yaml
(生成了_site目录)
root@AR:/usr/local/david.sferruzza.fr#  cd _site
root@AR:/usr/local/david.sferruzza.fr/_site# ls
archive.html  assets  atom.xml    index.html  posts  tags
root@AR:/usr/local/david.sferruzza.fr/_site#
(可见/usr/local/david.sferruzza.fr/_site就是静态网站的根目录)

新建源帖:
root@AR:/usr/local/david.sferruzza.fr/_site# cd ../posts
root@AR:/usr/local/david.sferruzza.fr/posts# nano 2016-12-22-test-1.md
root@AR:/usr/local/david.sferruzza.fr/posts# cat 2016-12-22-test-1.md
---
title: 测试1
author: brite fisherman
lang: en
tags: misc1, misc2, misc3
description: 点击标题,看全文
published: 2016-12-22 11:05:00
---

这是测试1.

root@AR:/usr/local/david.sferruzza.fr/posts# cd ..
root@AR:/usr/local/david.sferruzza.fr# .stack-work/dist/i386-linux/Cabal-1.22.5.0/build/david-sferruzza-fr/david-sferruzza-fr build

演示网站:http://ds.bright.biz.st/
项目地址:https://github.com/dsferruzza/david.sferruzza.fr