Total Pageviews

Tuesday 31 January 2017

搭建基于haskell的静态博客程序passingcuriosity.com(非常漂亮,还支持分页)

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


cd /usr/local
git clone https://github.com/thsutton/passingcuriosity.com
cd passingcuriosity.com

root@AR:/usr/local/passingcuriosity.com# stack build
会显示:
...
Linking .stack-work/dist/i386-linux/Cabal-1.24.0.0/build/site/site ...
site-0.1.0.0: copy/register
Installing executable(s) in
/usr/local/passingcuriosity.com/.stack-work/install/i386-linux/lts-7.14/8.0.1/bin
Completed 120 action(s).
root@AR:/usr/local/passingcuriosity.com# .stack-work/dist/i386-linux/Cabal-1.24.0.0/build/site/site build (此即生成/更新静态网站的根目录的命令)
root@AR:/usr/local/passingcuriosity.com# ls
HLint.hs     about.md     contact.md   files     reading.md  tags.md
README.markdown  archives.md  drafts       index.md  site.cabal  talks
assets       errors       notes     site.hs     templates
_site         bin          favicon.ico  posts     stack.yaml
root@AR:/usr/local/passingcuriosity.com# cd _site
root@AR:/usr/local/passingcuriosity.com/_site# ls
2004  2007  2010  2013    2016   archives  contact      feed.rss      tags
2005  2008  2011  2014    2017   assets     errors       files
2006  2009  2012  2015    about  atom.xml  favicon.ico  index.html
root@AR:/usr/local/passingcuriosity.com/_site#
(可见/usr/local/passingcuriosity.com/_site就是静态网站的根目录)

新建源帖:
root@AR:/usr/local/passingcuriosity.com/_site# cd ../posts
root@AR:/usr/local/passingcuriosity.com/posts# nano 2017-01-31-test-1.md
root@AR:/usr/local/passingcuriosity.com/posts# cat 2017-01-31-test-1.md
---
title: 测试1
tags: misc1, misc2, misc3
location: china
excerpt: 点击标题,看全文
---

这是测试1。

看看如何?

root@AR:/usr/local/passingcuriosity.com/posts#  cd ..
root@AR:/usr/local/passingcuriosity.com# .stack-work/dist/i386-linux/Cabal-1.24.0.0/build/site/site rebuild

演示网站:http://pcc.bright.biz.st/
项目地址:https://github.com/thsutton/passingcuriosity.com

No comments:

Post a Comment