Total Pageviews

Tuesday, 9 August 2016

安装基于haskell的静态博客程序HasClunk

首先按http://briteming.blogspot.com/2016/07/haskellghc.html,安装haskell(ghc/cabal)环境。
cd /usr/local/
git clone https://github.com/jellehermsen/HasClunk hasclunk-site
cd hasclunk-site

root@AR:/usr/local/hasclunk-site# ls
Build.hs Html.hs  Main.hs      Rss.hs
DefaultFiles.hs  HasClunk.cabal  Init.hs  PostMeta.hs  Setup.hs
dist Helpers.hs LICENSE  README.md

root@AR:/usr/local/hasclunk-site# cabal install (安装基于haskell的博客程序)
root@AR:/usr/local/hasclunk-site# mkdir hasclunk-blog
root@AR:/usr/local/hasclunk-site# cd hasclunk-blog
root@AR:/usr/local/hasclunk-site/hasclunk-blog# hasclunk init (初始化博客的目录结构。会在当前目录下生成一些文件和文件夹)
root@AR:/usr/local/hasclunk-site/hasclunk-blog# ls
assets config pages  posts  template
root@AR:/usr/local/hasclunk-site/hasclunk-blog# hasclunk build (这个就是生成/更新静态网站的根目录的命令。会在当前目录下,生成website目录)
root@AR:/usr/local/hasclunk-site/hasclunk-blog# ls
assets config pages  posts  template website
root@AR:/usr/local/hasclunk-site/hasclunk-blog# cd website
root@AR:/usr/local/hasclunk-site/hasclunk-blog/website# ls
archive.html  assets  categories  feed.xml  index.html pages  posts
(/usr/local/hasclunk-site/hasclunk-blog/website/果然就是静态网站的根目录,你可绑定域名到该目录)
root@AR:/usr/local/hasclunk-site/hasclunk-blog/website#

新建源贴:
root@AR:/usr/local/hasclunk-site/hasclunk-blog/website# cd ..
root@AR:/usr/local/hasclunk-site/hasclunk-blog# ls
assets config pages  posts  template website
root@AR:/usr/local/hasclunk-site/hasclunk-blog# cd posts
root@AR:/usr/local/hasclunk-site/hasclunk-blog/posts# ls
2015-07-14-hello-world.md      
root@AR:/usr/local/hasclunk-site/hasclunk-blog/posts# nano 2016-08-08-test-1.md
(按2015-07-14-hello-world.md的内容格式,新建帖子2016-08-08-test-1.md,内容如下:
<!--
title: 测试1
categories: misc1, misc2, misc3
-->

这是测试1. )
root@AR:/usr/local/hasclunk-site/hasclunk-blog/posts# cd ..
root@AR:/usr/local/hasclunk-site/hasclunk-blog# nano config
(编辑config文件,把里面的url的值改为http://yourdomain.com/ )
root@AR:/usr/local/hasclunk-site/hasclunk-blog# hasclunk build

演示网站: http://hc.smt.biz.st
项目地址:https://github.com/jellehermsen/HasClunk
同一天的帖子并非按发表的时间顺序排列,不同天的帖子按发表的时间顺序(只能精确到“天”)排列。有部分静态博客程序是这样子的。