美文网首页管理系统
个人hexo博客部署到Coding.net

个人hexo博客部署到Coding.net

作者: 焰火青春 | 来源:发表于2017-09-19 15:19 被阅读324次

此文旨在解决hexo个人博客部署到github访问慢的问题

解决办法:

  • 把博客部署到Coding.net
  • 买独立域名
  • 其他
    这里只介绍把博客部署到Coding.net

部署步骤

新建项目

仓库名字必须与Coding.net账户名字一致

仓库名
  • 添加公钥
    上面设置完毕之后点击创建项目,然后点击设置->部署公钥->新建部署公钥,之前部署到Github上的时候,本地目录 C\User(中文为用户)(电脑用户名).ssh 目录下会有 github.rsa.pub 公钥文件,打开然后复制里面的内容,直接贴在这里的公钥框中:
    勾选推送权限
添加公钥
  • 绑定公钥
    打开git shell输入以下命令

ssh -T git@git.coding.NET

绑定成功会出现以下代码:

C:\Users\hasee-pc\Documents\GitHub> ssh -T git@git.coding.NET
Warning: Permanently added 'git.coding.net,14.215.101.70' (RSA) to the list of known hosts.
Coding.net Tips : [Hello! You've connected to Coding.net via SSH. This is a deploy key.]

  • 修改hexo配置
    打开hexo本地的配置文件 _config.yml,修改 deploy 的配置内容,这里设置了运行hexo d之后部署的目的地址,原本只有Github地址,现在把Coding.net的地址添加进去: (codingfengj为coding的用户名
deploy:
  type: git
  repo:
        github: git@github.com:linshuhe1/linshuhe1.github.io.git,master
        coding: git@git.coding.net:codingfengj/codingfengj.git,master  

在source目录下新建一个文件,命名为Statifile,不带文件后缀。

cd source 
hexo init  Statifile

也可以直接新建

  • 正式部署到Coding.net
    打开git shell或者cmd管理员,定位到仓库根目录下
E:
cd  **.github.io    #这是我的仓库根目录

输入以下命令:

hexo clean
hexo generate    #生成静态网页    
hexo deploy       #开始部署

提交成功的话命令行提示:

On branch master
nothing to commit, working directory clean
Warning: Permanently added 'github.com,192.30.255.112' (RSA) to the list of known hosts.
Branch master set up to track remote branch master from git@github.com:linshuhe1/linshuhe1.github.io.git.
Everything up-to-date
On branch master
nothing to commit, working directory clean
Warning: Permanently added 'git.coding.net,180.97.181.69' (RSA) to the list of known hosts.
Branch master set up to track remote branch master from git@git.coding.net:linshuhe1/linshuhe1.git.
To git@git.coding.net:linshuhe1/linshuhe1.git
* [new branch]      HEAD -> master
INFO  Deploy done: git  
  • 设置Coding Page
    打开Coding.net的项目管理界面,打开代码->Pages服务,选择部署来源为master分支,然后保存即可:
master分支
设置完毕后即可打开你的Coding地址访问博客了。

相关文章

网友评论

    本文标题:个人hexo博客部署到Coding.net

    本文链接:https://www.haomeiwen.com/subject/hvcwsxtx.html