Total Pageviews

Thursday, 11 August 2016

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

先按此文http://briteming.blogspot.com/2016/07/haskellghc.html,安装ghc/cabal环境,
再按此文
https://docs.haskellstack.org/en/stable/README/ ,(https://docs.haskellstack.org/en/stable/install_and_upgrade/) 安装stack:
运行curl -sSL https://get.haskellstack.org/ | sh
        (会显示:
        ...
        Stack has been installed to: /usr/local/bin/stack )

cabal install scotty

git clone https://github.com/soupi/hablog
cd hablog
stack build
会显示:
...
Installing executable(s) in
/usr/local/hablog/.stack-work/install/i386-linux/lts-5.17/7.10.3/bin
...
root@AR:/usr/local/hablog# ls /usr/local/hablog/.stack-work/install/i386-linux/lts-5.17/7.10.3/bin
hablog
root@AR:/usr/local/hablog# echo 'export PATH=$PATH:/usr/local/hablog/.stack-work/install/i386-linux/lts-5.17/7.10.3/bin' >> /etc/profile
root@AR:/usr/local/hablog# . /etc/profile
root@AR:/usr/local/hablog#

root@AR:/usr/local/hablog# ls
app     hablog.cabal  _pages  README.md  src static
circle.yml  LICENSE   _posts  Setup.hs   stack.yaml
root@AR:/usr/local/hablog# cd _posts
root@AR:/usr/local/hablog/_posts# ls
haskell-code-test.md

root@AR:/usr/local/hablog/_posts# nano test-1.md
(按haskell-code-test.md的内容格式,新建源贴test-1.md如下:
title: 测试1
authors: brite
route: test-1
date: 2016-08-11 16:39
tags: misc1, misc2, misc3, misc4
---

这是测试1. )
root@AR:/usr/local/hablog/_posts# cd ..
root@AR:/usr/local/hablog# nohup hablog 6688 > /dev/null &
(这个就是生成/更新静态网站的命令。6688是我随便指定的端口,只要是服务器上未被占用的端口就行。)

访问http://surmount.biz.st:6688即可看到网站效果。它这个程序不生成静态网站的根目录,所以可以用nginx做反向代理,代理这个网站地址http://surmount.biz.st:6688

演示网站:http://surmount.biz.st:6688
项目地址:https://github.com/soupi/hablog
此博客程序似乎不能分页。