Total Pageviews

Wednesday 4 January 2017

搭建基于bash的静态相册网站程序-expose

git clone https://github.com/Jack000/Expose expose
cd expose

root@AR:~/expose# ls
expose.sh  LICENSE.txt    Markdown_1.0.1    readme.md  theme1  theme2
root@AR:~/expose# cd /usr/local
root@AR:/usr/local# mkdir expose-site
root@AR:/usr/local/expose-site#
(从网上下载一些图片文件到当前目录下。并给图片文件编号)
root@AR:/usr/local/expose-site# ls
00-golden-gate-bridge.jpg  01-inner-mongolia.txt  03-google-inc.jpg
00-golden-gate-bridge.txt   02-hk-street.jpg           03-google-inc.txt
01-inner-mongolia.jpg        02-hk-street.txt     
root@AR:/usr/local/expose-site#
(然后针对每个图片文件,新建一个同名的txt文件,这样txt文件里的文字会显示在图片里面)
root@AR:/usr/local/expose-site# cat 00-golden-gate-bridge.txt
这是雾中的金门桥。

看看如何?

root@AR:/usr/local/expose-site# ~/expose/expose.sh (这就是生成/更新静态网站的根目录的命令)
root@AR:/usr/local/expose-site# ls
00-golden-gate-bridge.jpg  01-inner-mongolia.txt  03-google-inc.jpg
00-golden-gate-bridge.txt  02-hk-street.jpg      03-google-inc.txt
01-inner-mongolia.jpg       02-hk-street.txt      _site
root@AR:/usr/local/expose-site#
(生成了_site目录)
root@AR:/usr/local/expose-site# cd _site
root@AR:/usr/local/expose-site/_site# ls
cookie.js   global.js          googleinc  img         innermongolia
global.css  goldengatebridge  hkstreet     index.html  json.js
root@AR:/usr/local/expose-site/_site#
(可见/usr/local/expose-site/_site就是静态网站的根目录。你可绑定域名到该目录)

 演示网站:http://ep.bright.biz.st
项目地址: https://github.com/Jack000/Expose