Total Pageviews

Friday, 3 February 2017

搭建基于pandoc的静态博客程序issarice.com

首先安装python的pip模块:
easy_install pip

然后安装cabal:
curl -sSL https://get.haskellstack.org/ | sh
        (这一步为安装stack)
stack install cabal-install( 这一步为安装cabal)

pip install pandocfilters
cabal install pandoc-1.19

cd /usr/local
git clone https://github.com/riceissa/issarice.com
cd issarice.com

root@AR:/usr/local/issarice.com# ls
Makefile   TODO.txt  css       generator  page_reqs.txt  templates
README.md   external  images      static     wiki
root@AR:/usr/local/issarice.com# make fullsite (会在当前目录 下,生成_site目录)
root@AR:/usr/local/issarice.com# ls
Makefile   TODO.txt  css       generator  page_reqs.txt  templates
README.md  _site     external  images      static     wiki
root@AR:/usr/local/issarice.com# cd _site
root@AR:/usr/local/issarice.com/_site#
root@AR:/usr/local/issarice.com/_site# find . -name index
./index
root@AR:/usr/local/issarice.com/_site#
(这个index文件其实就是index.html,所以 /usr/local/issarice.com/_site就是静态网站的根目录。)
root@AR:/usr/local/issarice.com/_site# cd ../templates
root@AR:/usr/local/issarice.com/templates# nano default.html5
(修改第65行,把Newest changes改为点击此处,看帖子
参见https://github.com/riceissa/issarice.com/blob/master/templates/default.html5)

新建源帖:
root@AR:/usr/local/issarice.com/_site# cd ../wiki
root@AR:/usr/local/issarice.com/wiki# nano test-1.md
root@AR:/usr/local/issarice.com/wiki# cat test-1.md
---
title: 测试1
author: brite fisherman
created: 2017-02-02
date: 2017-02-02
status: notes
---

这是测试1.

看看如何?

root@AR:/usr/local/issarice.com/wiki# cd ..
root@AR:/usr/local/issarice.com# make fullsite (这样_site目录就得到了更新.如果更新不及时,则rm -rf _site && make fullsite)
root@AR:/usr/local/issarice.com# cd _site
root@AR:/usr/local/issarice.com/_site# mv index index.html

演示网站:http://irc.bright.biz.st
项目地址:https://github.com/riceissa/issarice.com

注:源帖的命名规则类似搭建基于haskell的静态博客程序alhassy-blog.

No comments:

Post a Comment