Pages

Saturday, 12 November 2016

搭建基于java的静态博客程序scalatic

首先安装java环境。若你的vps是debian/ubuntu系统,可参看http://briteming.blogspot.com/2016/11/debianubuntuoracle-java8jdk8.html

wget https://github.com/padurean/scalatic/releases/download/0.1.0/scalatic-0.1.0.jar
chmod 755 scalatic-0.1.0.jar

cd /usr/local
git clone https://github.com/padurean/scalatic scalatic-site
cd scalatic-site
cd src/test/scala/scalatictest


root@AR:/usr/local/scalatic-site/src/test/scala/scalatictest# ls
expected  new  source  

root@AR:/usr/local/scalatic-site/src/test/scala/scalatictest# ~/scalatic-0.1.0.jar .
(这个就是生成/更新静态网站的根目录的命令)
root@AR:/usr/local/scalatic-site/src/test/scala/scalatictest# ls
expected  new  source  target
(生成了target目录)
root@AR:/usr/local/scalatic-site/src/test/scala/scalatictest# cd target
root@AR:/usr/local/scalatic-site/src/test/scala/scalatictest/target# ls
Blog-post-Sample-One-2015-06-15-03-45.html  jquery-1.12.4.min.js
Blog-post-Sample-Two-2015-07-03-23-45.html  normalize.css
cayman.css     
github-light.css     
github-markdown.css     
index.html     
root@AR:/usr/local/scalatic-site/src/test/scala/scalatictest/target# 
(可见/usr/local/scalatic-site/src/test/scala/scalatictest/target就是静态网站的根目录)

新建源帖:
root@AR:/usr/local/scalatic-site/src/test/scala/scalatictest/target# cd ../new
root@AR:/usr/local/scalatic-site/src/test/scala/scalatictest/new# 
(按https://github.com/padurean/scalatic/tree/master/src/test/scala/scalatictest/new里的Blog-post-Sample-One-2015-06-15-03-45.md,新建源帖test-1-2016-11-13-09-31.md,其内容为:
# 测试1

这是测试1.

看看如何?  )
root@AR:/usr/local/scalatic-site/src/test/scala/scalatictest/new# cd ..
root@AR:/usr/local/scalatic-site/src/test/scala/scalatictest# ~/scalatic-0.1.0.jar .
显示:
Rendering ./new/一个东方国家的盛世和蝼蚁-2016-11-13-12-36.md ...
Writing ./target/一个东方国家的盛世和蝼蚁-2016-11-13-12-36.html ...
Moving ./new/一个东方国家的盛世和蝼蚁-2016-11-13-12-36.md to ./source/posts/一个东方国家的盛世和蝼蚁-2016-11-13-12-36.md ...
Writing ./target/index.html ...
Copying ./source/github-light.css to ./target/github-light.css ...
Copying ./source/cayman.css to ./target/cayman.css ...
Copying ./source/jquery-1.12.4.min.js to ./target/jquery-1.12.4.min.js ...
Copying ./source/github-markdown.css to ./target/github-markdown.css ...
Copying ./source/normalize.css to ./target/normalize.css ...
root@AR:/usr/local/scalatic-site/src/test/scala/scalatictest# 

演示网站:http://slt.bright.biz.st
项目地址:https://github.com/padurean/scalatic

这个静态博客程序好像无法分页。