Total Pageviews

Saturday, 31 May 2014

在linux vps上搭建基于racket的静态博客程序-frog

wget http://mirror.racket-lang.org/installers/6.0.1/racket-6.0.1-i386-linux-debian-squeeze.sh
sh racket-6.0.1-i386-linux-debian-squeeze.sh
(安装路径选择/usr/local/racket)
export PATH=$PATH:/usr/local/racket/bin
echo 'export PATH=$PATH:/usr/local/racket/bin'  >>  /etc/profile
 (这样,racket就装好了。其他系统,见这里:
http://download.racket-lang.org/)


raco pkg install frog
easy_install --upgrade Pygments
cd /usr/local
mkdir frog-site
cd frog-site
raco frog --init
显示:
Frog 0.17
Configuration /usr/local/frog-site/.frogrc not found; using defaults.
Creating files in /usr/local/frog-site/:
/usr/local/frog-site/.frogrc (这个.frogrc就是frog的配置文件,在这文件里,可修改每页显示的帖子数,我改为了3)
/usr/local/frog-site/_src/About.md
/usr/local/frog-site/_src/page-template.html
/usr/local/frog-site/_src/post-template.html
/usr/local/frog-site/_src/posts/2012-01-01-a-2012-blog-post.md
/usr/local/frog-site/css/
/usr/local/frog-site/js/
/usr/local/frog-site/img/
Project ready. Try `raco frog -bp` to build and preview.

root@AR:/usr/local/frog-site# raco frog -b (这个就是生成/更新静态网站的命令)
root@AR:/usr/local/frog-site# ls
About.html  blog  css  feeds  img  index.html  js  sitemap.txt  _src  tags
(新出现了好多东西,而且出现了index.html文件,可见/usr/local/frog-site/就是静态网站的根目录)

发贴方法:
root@AR:/usr/local/frog-site# cd _src
root@AR:/usr/local/frog-site/_src# ls
About.md  index-template.html  page-template.html  posts  post-template.html
root@AR:/usr/local/frog-site/_src# cd posts
root@AR:/usr/local/frog-site/_src/posts# ls
2012-01-01-a-2012-blog-post.md
root@AR:/usr/local/frog-site/_src/posts# nano 2014-05-31-test1.md
按2012-01-01-a-2012-blog-post.md的格式,新建帖子2014-05-31-test1.md,格式如下:
    Title: test1
    Date: 2014-05-31T14:45:00
    Tags: misc1, misc2, misc3

这是测试1.
(注意:上面三行必须空4格才写)


然后,
root@AR:/usr/local/frog-site/_src/posts# cd ../..
root@AR:/usr/local/frog-site# raco frog -b (或者raco frog --build)

演示站点:http://frog.bright.biz.st
项目地址:https://github.com/greghendershott/frog
-------

演示网站:http://blog.racket-lang.org/
项目地址:https://github.com/racket/racket-lang-org
https://github.com/mbutterick/racket-blog