Total Pageviews

Sunday, 9 April 2017

搭建基于lua的静态博客程序motyl

先按此文http://briteming.blogspot.co.uk/2014/06/lua.html安装lua.
然后,
luarocks install luafilesystem
luarocks install lunamark
luarocks install lustache

wget http://pyyaml.org/download/libyaml/yaml-0.1.7.tar.gz
tar zxvf yaml-0.1.7.tar.gz
cd yaml-0.1.7
./configure
make
make install

cd /usr/local
git clone https://github.com/fcambus/motyl  motyl-site
cd motyl-site

root@localhost:/usr/local/motyl-site# ls
AUTHORS  examples  LICENSE  README.md  src  TODO
root@localhost:/usr/local/motyl-site# cd examples
root@localhost:/usr/local/motyl-site/examples# ls
Makefile  motyl.conf  pages  posts  static 
root@localhost:/usr/local/motyl-site/examples# git clone https://github.com/fcambus/chrysalide themes
root@localhost:/usr/local/motyl-site/examples# ls
Makefile  motyl.conf pages  posts  static themes 
root@localhost:/usr/local/motyl-site/examples#
root@localhost:/usr/local/motyl-site/examples# ls ../src
motyl.lua
root@localhost:/usr/local/motyl-site/examples# cp ../src/motyl.lua ./
root@localhost:/usr/local/motyl-site/examples# ls
Makefile motyl.conf motyl.lua pages posts static themes
root@localhost:/usr/local/motyl-site/examples# ./motyl.lua (此即生成/更新静态网站的根目录的命令)
root@localhost:/usr/local/motyl-site/examples# ls
deploy  Makefile  motyl.conf  motyl.lua  pages  posts  static  themes
(生成了deploy目录)
root@localhost:/usr/local/motyl-site/examples#  cd deploy
root@localhost:/usr/local/motyl-site/examples/deploy# ls
about  atom.xml categories  hello-world  index.html 
root@localhost:/usr/local/motyl-site/examples/deploy#
(可见/usr/local/motyl-site/examples/deploy就是静态网站的根目录)

新建源帖:
root@localhost:/usr/local/motyl-site/examples/deploy# cd ..
root@localhost:/usr/local/motyl-site/examples# ls
deploy  Makefile  motyl.conf  motyl.lua  pages  posts  static  themes
root@localhost:/usr/local/motyl-site/examples# cd posts
root@localhost:/usr/local/motyl-site/examples/posts# nano test-1.yaml
root@localhost:/usr/local/motyl-site/examples/posts# cat test-1.yaml
title: 测试1
date: 2017-04-09 19:54
description: 点击标题,看全文
keywords: motyl, lua
categories:
- misc1
- misc2
- misc3

root@localhost:/usr/local/motyl-site/examples/posts# nano test-1.md
root@localhost:/usr/local/motyl-site/examples/posts# cat test-1.md
这是测试1.

看看如何?

root@localhost:/usr/local/motyl-site/examples/posts#
root@localhost:/usr/local/motyl-site/examples/posts# cd ..
root@localhost:/usr/local/motyl-site/examples# ./motyl.lua

演示网站:http://mt.bright.biz.st/
(不支持嵌入iframe代码,但是应该支持嵌入embed代码)
项目地址:https://github.com/fcambus/motyl/
https://github.com/fcambus/motyl/issues/3

相关帖子:http://briteming.blogspot.com/2014/08/linux-vpslua-luapress.html

No comments:

Post a Comment