Total Pageviews

Thursday 29 May 2014

在linux vps上搭建基于php的静态网站/博客程序-yellowcms(这个不错)

cd /var/www/
git clone https://github.com/markseu/yellowcms
cd yellowcms

as3:/var/www/yellowcms# ls
content  media  README.md  system  yellow.php
as3:/var/www/yellowcms# cd content
as3:/var/www/yellowcms/content# ls
1-home  2-about
as3:/var/www/yellowcms/content# mkdir 3-blog
as3:/var/www/yellowcms/content# mkdir 4-test2
as3:/var/www/yellowcms/content#
as3:/var/www/yellowcms/content# ls 2-about
page.txt
as3:/var/www/yellowcms/content# cd 4-test2
as3:/var/www/yellowcms/content/4-test2# nano page.txt
按/var/www/yellowcms/content/2-about/page.txt的格式,新建页面文件page.txt,格式如下:
---
Title: 测试2
---

这是测试2.


保存文件,网站就自动更新了。访问http://as3.brite.biz/yellowcms/即可看到网站效果。

as3:/var/www/yellowcms/content/4-test2# cd /var/www/yellowcms/
as3:/var/www/yellowcms# git clone https://github.com/markseu/yellowcms-extensions
as3:/var/www/yellowcms# cd yellowcms-extensions
as3:/var/www/yellowcms/yellowcms-extensions# ls
documentation  plugins  README.md  snippets  styles  templates
as3:/var/www/yellowcms/yellowcms-extensions# ls templates
blog  contact  feed  search  sitemap  wiki
as3:/var/www/yellowcms/yellowcms-extensions# cd templates/blog
as3:/var/www/yellowcms/yellowcms-extensions/templates/blog# ls
2013-04-07-blog-article.txt  blog.php  README.md
blogarticles.php             page.txt  text.ini
as3:/var/www/yellowcms/yellowcms-extensions/templates/blog# mkdir /var/www/yellowcms/content/3-blog/
as3:/var/www/yellowcms/yellowcms-extensions/templates/blog# cd /var/www/yellowcms/system
as3:/var/www/yellowcms/system# ls
config  core  plugins  snippets  templates
as3:/var/www/yellowcms/system# cd templates
as3:/var/www/yellowcms/system/templates# cp /var/www/yellowcms/yellowcms-extensions/templates/blog/blogarticles.php .
as3:/var/www/yellowcms/system/templates# cp /var/www/yellowcms/yellowcms-extensions/templates/blog/blog.php .
as3:/var/www/yellowcms/system/templates# cp /var/www/yellowcms/yellowcms-extensions/templates/blog/page.txt /var/www/yellowcms/content/3-blog/
as3:/var/www/yellowcms/system/templates# cp /var/www/yellowcms/yellowcms-extensions/templates/blog/2013-04-07-blog-article.txt /var/www/yellowcms/content/3-blog/
as3:/var/www/yellowcms/system/templates# cd /var/www/yellowcms/content/3-blog/
as3:/var/www/yellowcms/content/3-blog# ls
2013-04-07-blog-article.txt
page.txt
访问http://as3.brite.biz/yellowcms/blog/即可看到博客效果。

发贴方法:
as3:/var/www/yellowcms/content/3-blog# nano 2014-05-28-black-dot-on-white-paper.txt
按2013-04-07-blog-article.txt的格式,新建帖子2014-05-28-black-dot-on-white-paper.txt,格式为:
---
Title: 白纸上的黑点
Published: 2014-05-28 21:26
Tag: misc
---

有一对夫妻感情关系一直不好,天天说对方的不是...


保存文件,该博客就自动更新了。

演示站点:http://as3.brite.biz/yellowcms/,http://as3.brite.biz/yellowcms/blog/
项目地址:https://github.com/markseu/yellowcms
https://github.com/markseu/yellowcms-extensions
https://github.com/markseu/yellowcms-extensions/tree/master/templates/blog


看上面的内容,没用到特殊命令,可知这个基于php的静态网站/博客程序在普通php空间上应该也可使用。