Total Pageviews

Thursday 1 December 2016

上传vps上的静态网站到netlify.com空间

 首先在本地机器的浏览器中,访问https://app.netlify.com/signup,注册账号。

然后在linux vps上搭建nodejs环境。
然后,
npm install netlify-cli -g
cd到某个静态网站的根目录,比如
cd /usr/local/heckle-by-marijnh/blog/_site
 
root@AR:/usr/local/heckle-by-marijnh/blog/_site# netlify deploy
会显示:
Please visite this authentication URL in your browser:
https://app.netlify.com/authorize?response_type=ticket&ticket=一长串字符
No site id specified, create a new site?(Yn) (回车)
Path to deploy? (current dir) (回车)
Deploying folder: /usr/local/heckle-by-marijnh/blog/_site (等待直到上传完成)

Deploy is live (permalink):
http://584119766686740e43ef4a1a.diplomat-transfer-70311.netlify.com

Last build is always accessible on http://diplomat-transfer-70311.netlify.com

root@AR:/usr/local/heckle-by-marijnh/blog/_site#

在你本地机器的浏览器中访问http://diplomat-transfer-70311.netlify.com,即可看到
上传到netlify.com空间的你的静态网站的地址。网站效果跟我在linux vps上搭建的静态网站
http://hc.bright.biz.st完全一样。

当然,你也可把在本地的linux桌面系统或mac系统上搭建的静态网站上传到netlify.com空间。
(需先在本地的linux桌面系统或mac系统上,搭建nodejs环境,之后,跟linux vps上的操作
是一样的。) 
 
文档地址:https://www.netlify.com/docs/welcome/ 

类似的服务:http://briteming.blogspot.com/2016/08/surgesh.html