Total Pageviews

Thursday 7 August 2014

在linux vps上搭建基于纯shell命令的静态博客程序-skf

首先安装skf:
git clone https://github.com/moebiuseye/skf
cd skf

root@as3:~/skf# make install
显示:
mkdir -p /usr/bin
install -m 755 ./skf{,.gen,.init} -t /usr/bin/
mkdir -p /usr/share/skf
cp -R ./share/* -t /usr/share/skf/
find /usr/share/skf -type f -exec chmod 644 {} \;
find /usr/share/skf -type d -exec chmod 755 {} \;
root@as3:~/skf# whereis skf
显示:
skf: /usr/bin/skf /usr/bin/skf.gen /usr/bin/skf.init /usr/share/skf
这样,skf安装完毕。

root@as3:~/skf# cd ~
root@as3:~# git clone https://github.com/moebiuseye/skf.jeannedhack.org skf.jeannedhack.org-site
root@as3:~# cd skf.jeannedhack.org-site

root@as3:~/skf.jeannedhack.org-site#
root@as3:~/skf.jeannedhack.org-site# ls
css            fonts        index.md  left.md   News    README.md
documentation  header.tail  js        Makefile  robots.txt
root@as3:~/skf.jeannedhack.org-site# nano .skfrc
(编辑skf的配置文件.skfrc,把export base_url的值改为你要绑定的域名地址,我的为"http://skf.briteming.yi.org/")
root@as3:~/skf.jeannedhack.org-site# skf --recursive --generate . output
(或者用skf -r -g . output也可。这个就是生成/更新静态网站的命令)
root@as3:~/skf.jeannedhack.org-site# ls
css            fonts        index.md  left.md   News    README.md
documentation  header.tail  js        Makefile  output  robots.txt
(新出现了output目录)
root@as3:~/skf.jeannedhack.org-site# cd output
root@as3:~/skf.jeannedhack.org-site/output# ls
css  documentation  fonts  index.html  js  News  robots.txt
(可见~/skf.jeannedhack.org-site/output/就是静态网站的根目录)
root@as3:~/skf.jeannedhack.org-site/output#

发贴方法:
root@as3:~/skf.jeannedhack.org-site/output# cd ~/skf.jeannedhack.org-site/News/posts/
root@as3:~/skf.jeannedhack.org-site/News/posts# nano 2014-08-07-1700-test2.md
格式为:
title:测试2

这是测试2.


然后,
root@as3:~/skf.jeannedhack.org-site/News/posts# cd ~/skf.jeannedhack.org-site
root@as3:~/skf.jeannedhack.org-site# nano index.md
(在此行:The aim of this program is to provide a way的上一行,加上<p><a href=/News>点击此处,访问博客</a></p>)
root@as3:~/skf.jeannedhack.org-site# skf --recursive --generate . output

演示站点:http://skf.briteming.yi.org
项目地址:http://skf.jeannedhack.org/documentation/02_Usage.html
https://github.com/moebiuseye/skf
https://github.com/moebiuseye/skf.jeannedhack.org

相关帖子:http://briteming.blogspot.co.uk/2014/01/linux-vpsshellsimple-static.html