美文网首页
mac Github+Hexo

mac Github+Hexo

作者: 手捧樱花v | 来源:发表于2020-04-06 15:04 被阅读0次
  1. https://github.com/ 注册用户
  2. 新建工程 ssh-keygen -t rsa -C [ur_mail] 配置ssh-key 克隆项目 新建一个index.html后git push
  3. 项目工程 setting -- GitHub Pages --选择有index的分支 --配置domain 保存
  4. 保存成功后可使用costume Domain访问index页面
  5. 安装nodejs / yarn /hexo 需要su权限 注意su需要重新ssh-keygen/npm install的warn可忽略
    1)查看node源 npm get registry
    2)安装yarn npm install -g yarn --registry=https://registry.npm.taobao.org
    3)更改源 npm config set registry http://registry.npm.taobao.org/
    4)更改源 yarn config set registry http://registry.npm.taobao.org
    5)恢复源 npm config set registry https://registry.npmjs.org/
  6. 安装及配置Hexo 需要su权限 注意su需要重新ssh-keygen/npm install的warn可忽略
    1)安装hexo npm install -g hexo-cli
    2)创建文件夹放代码 mkdir sakura
    3)hexo init sakura
    4)cd sakura; npm install
    5)安装server模块 npm install hexo-server --save
    6)hexo server启动服务 默认localhost:4000访问
    7)安装Hexo git依赖 npm install hexo-deployer-git --save
    8)配置_config.yml
# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://yoururl.com
root: /
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type: git
  repo: pro_url
  branch: master

9) CNAME填写 costume Domain
10)生成静态public文件 hexo generate g
11)一键部署到github

hexo clean && hexo d

相关文章

网友评论

      本文标题:mac Github+Hexo

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