Total Pageviews

Tuesday 13 May 2014

在linux vps上安装基于perl的静态博客程序-minerl

wget https://raw.github.com/miyagawa/cpanminus/master/cpanm --no-check-certificate
chmod 755 cpanm

cpanm Config::IniFiles HTML::Template Text::Template Text::MultiMarkdown Text::Textile Getopt::Compact::WithCmd HTTP::Server::Brick
git clone https://github.com/neevek/minerl minerl-site

as3:~# cd minerl-site
as3:~/minerl-site# ls
Changes  lib  Makefile  MANIFEST  minerl.pl  README.md  t  test-dependencies.pl
as3:~/minerl-site# make && make install
显示:
...
chmod +x minerl
cp minerl /usr/local/bin
as3:~/minerl-site# ls
Changes  Makefile  minerl     README.md  test-dependencies.pl
lib      MANIFEST  minerl.pl  t
(新出现了minerl文件)
as3:~/minerl-site#
as3:~/minerl-site# minerl -h
minerl v0.02
usage: minerl [options] COMMAND
options:
   -h, --help      This help message
Implemented commands are:
   build        - Applies the templates on the pages, generates the final HTML pages
   createpost   - Creates the skeleton of a new post                           
   generate     - Creates a brand new Minerl site                              
   serve        - Starts an HTTP server to serve the directory specified by the 'output_dir' property in minerl.cfg
See 'minerl help COMMAND' for more information on a specific command.
as3:~/minerl-site# git clone https://github.com/neevek/neevek.github.com neevek.github.com-site
as3:~/minerl-site# cd neevek.github.com-site
as3:~/minerl-site/neevek.github.com-site#
as3:~/minerl-site/neevek.github.com-site# ls
2014            archives  favicon.ico                  posts      tags
about.html      CNAME     googlea7c5812d2ba212b0.html  README.md
all-posts.html  css       index.html                   _src
as3:~/minerl-site/neevek.github.com-site# cd _src
as3:~/minerl-site/neevek.github.com-site/_src# ls
minerl.cfg  _pages  _raw  _templates
as3:~/minerl-site/neevek.github.com-site/_src# minerl createpost --filename test-one.md --format markdown --layout default --title test-one (这个就是新建源帖的命令.标题不要用中文,也不要用test1或test-1这样的标题,否则文章的链接地址会有问题。不要用test1.md或test-1.md这样的文件名,否则文章的链接地址会有问题)
Created: _pages/2014/05/13/test-one.md
as3:~/minerl-site/neevek.github.com-site/_src# nano _pages/2014/05/13/test-one.md
(可在正文的第一行加上:
## 测试1或<h2>测试1</h2>
这样就起到中文标题的作用)
as3:~/minerl-site/neevek.github.com-site/_src# minerl build (这个就是生成/更新静态网站的命令)
as3:~/minerl-site/neevek.github.com-site/_src# cd ..
as3:~/minerl-site/neevek.github.com-site# ls
2014            archives  favicon.ico                  posts      tags
about.html      CNAME     googlea7c5812d2ba212b0.html  README.md
all-posts.html  css       index.html                   _src
(可见~/minerl-site/neevek.github.com-site/就是静态网站的根目录)
as3:~/minerl-site/neevek.github.com-site# nohup Rwebserver 34294 > /dev/null &
访问http://as3.brite.biz:34294就可看到网站效果。

演示站点:http://as3.brite.biz:34294,http://mn.surmount.biz.wf
项目地址:https://github.com/neevek/minerl
https://github.com/neevek/neevek.github.com