Total Pageviews

Wednesday 30 November 2016

搭建基于hakyll的静态博客程序curry-club-augsburg.de

先按此文http://briteming.blogspot.com/2016/07/hakyll.html,搭建stack,ghc,hakyll.

cd /usr/local
git clone https://github.com/curry-club-aux/curry-club-augsburg.de
cd  curry-club-augsburg.de

root@AR:/usr/local/curry-club-augsburg.de# ls
404.html    curry-club-augsburg-de.cabal  files           posts

images       README.md
circle.yml            index.html       release.nix
CNAME        curry-site.hs          index.html.save  

COPYING.md  LICENSE.CC       stack.yaml
css        deploy.sh              LICENSE.MIT       templates
root@AR:/usr/local/curry-club-augsburg.de# ghc --make 
curry-site.hs 
(此步会生成可执行文件 curry-site)
root@AR:/usr/local/curry-club-augsburg.de# ./curry-site rebuild (这个就是生成/更新静态网站的根目录的命令)
root@AR:/usr/local/curry-club-augsburg.de# ls
404.html    curry-club-augsburg-de.cabal  files           posts
_cache        curry-site              images       README.md
circle.yml  curry-site.hi          index.html       release.nix
CNAME        curry-site.hs     _site
COPYING.md  curry-site.o          LICENSE.CC       stack.yaml
css        deploy.sh              LICENSE.MIT       templates

( 生成了_site目录)
root@AR:/usr/local/curry-club-augsburg.de# cd _site

root@AR:/usr/local/curry-club-augsburg.de/_site# ls
404.html  atom.xml  CNAME  css    files  images  index.html  posts  rss.xml

(可见/usr/local/curry-club-augsburg.de/_site就是静态网站的根目录)
root@AR:/usr/local/curry-club-augsburg.de/_site#

新建源帖:
root@AR:/usr/local/curry-club-augsburg.de/_site# cd ../posts
root@AR:/usr/local/curry-club-augsburg.de/posts# nano
2016-11-09-test-1.md
root@AR:/usr/local/curry-club-augsburg.de/posts# cat 2016-11-09-test-1.md
---
title: 测试1
description: abc
---

这是测试1.

看看如何?

root@AR:/usr/local/curry-club-augsburg.de/posts# cd ..

root@AR:/usr/local/curry-club-augsburg.de# ./curry-site rebuild

演示网站:http://cca.bright.biz.st/,不过 克隆下来的网站(德语网站)有很多内容是我不需要的,我不需要blog段以上的内容,解决办法就是:
root@AR:/usr/local/curry-club-augsburg.de# nano index.html
(把这行 $partial("templates/post-list.html")$的上面的所有内容删除)
root@AR:/usr/local/curry-club-augsburg.de#  ./curry-site rebuild 
项目地址:https://github.com/curry-club-aux/curry-club-augsburg.de
https://github.com/curry-club-aux/curry-club-augsburg.de/issues/63
https://github.com/curry-club-aux/curry-club-augsburg.de/issues/65