Total Pageviews

Sunday, 3 August 2014

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

先按此文http://briteming.blogspot.co.uk/2014/06/lua.html安装lua.

as3:~# git clone https://github.com/nickl1/Luapress luapress-old
as3:~# cd luapress-old
as3:~/luapress-old#
as3:~/luapress-old# ls
build               inc  LICENSE.md  posts      README.md
config.example.lua  lib  pages       luapress.lua  templates
as3:~/luapress-old# cp config.example.lua config.lua
as3:~/luapress-old# ls
build               config.lua  lib         pages  luapress.lua  templates
config.example.lua  inc         LICENSE.md  posts  README.md
as3:~/luapress-old# nano config.lua
(修改url的值为所绑定的域名地址:http://lp.bright.biz.st)
root@as3:~/luapress-old# cd build
root@as3:~/luapress-old/build# ls
inc  pages  posts
as3:~/luapress-old/build#
~/luapress-old/build/里面暂时没有index.html,需先建立至少一个源贴才行。
as3:~/luapress-old/build# cd ..
as3:~/luapress-old# cd posts
as3:~/luapress-old/posts# ls
as3:~/luapress-old/posts#   (此时posts里面什么源贴都没有)
as3:~/luapress-old/posts# nano test1.md
格式为:
## 测试1

这是测试1.


然后,
as3:~/luapress-old/posts# cd ..
as3:~/luapress-old# ./luapress.lua (这个就是生成/更新静态网站的命令)
会显示:
[Luapress]: Posts
        Post added: test1
[Luapress]: Pages
[Luapress]: Building posts
[Luapress]: Building pages
[Luapress]: Building indexes
[Luapress]: Building rss
[Luapress]: Copy inc
[Luapress]: Complete! Upload ./build to your website
root@as3:~/luapress-old# cd build
root@as3:~/luapress-old/build# ls
inc index.html  index.xml  pages  posts
(可见~/luapress-old/build/就是静态网站的根目录)
root@as3:~/luapress-old/build# nohup Rwebserver 34294 > /dev/null &

演示站点:http://lp.bright.biz.st
项目地址:https://github.com/nickl1/Luapress
(不要用这里https://github.com/Fizzadar/Luapress的源码,此处的源码有问题)
---------------------

(2017-04-03日更新)
先安装luarocks.
然后,
luarocks install luapress
 
cd /usr/local
luapress init luapress-site2 (此命令会在当前目录下,生成luapress-site2目录)
cd luapress-site2
 
root@localhost:/usr/local/luapress-site2# ls
config.lua  inc  pages  posts  templates
root@localhost:/usr/local/luapress-site2# cd posts
root@localhost:/usr/local/luapress-site2/posts# nano test1.md
root@localhost:/usr/local/luapress-site2/posts# cat test1.md
## 测试1

这是测试1.
<--MORE-->
 
看看如何?
root@localhost:/usr/local/luapress-site2/posts# cd ..
root@localhost:/usr/local/luapress-site2# luapress (此即生成/更新静态网站的
根目录的命令)
root@localhost:/usr/local/luapress-site2# ls
build  config.lua  inc  pages  posts  templates
(生成了build目录)
root@localhost:/usr/local/luapress-site2# cd build
root@localhost:/usr/local/luapress-site2/build# ls
inc  index.html  index.xml  pages  posts
root@localhost:/usr/local/luapress-site2/build# 
(可见/usr/local/luapress-site2/build就是静态网站的根目录)
 
演示网站:http://lp2.bright.biz.st/,(默认为5个帖子/页)
项目地址:http://luapress.org/
https://github.com/Fizzadar/Luapress (2014-08月份时,此源码有问题。现在应该
解决了)