有趣生活

当前位置:首页>科技>github如何建立网站通过GitHub免费构建个人网站

github如何建立网站通过GitHub免费构建个人网站

发布时间:2026-07-21阅读(1)

导读注册GitHub账号登陆GitHub账号,点击"Yourrepositories"new一个新的repositories,如下图填写:二:安装node.js....
  1. 注册GitHub账号
  2. 登陆GitHub账号,点击"Your repositories"
  3. new一个新的repositories,如下图填写:

二:安装node.js

  1. 下载node.js (Node.js);

2. 安装cnpm

# 选用淘宝镜像下载npm install -g cnpm --registry=https://registry.npm.taobao.org #安装失败可多次尝试cnpmcnpm -v

3. 安装hexo-cli

cnpm install -g hexo-clihexo -vD:cd Iblogchdir## 必须先安装githexo init

4. 启动博客

hexo s# INFO Hexo is running at http://localhost:4000/ . Press Ctrl C to stop.

三:上传博客

#新建博客hexo n "我的第一篇博客文章"cd source/_postsdircd ../../# 清理数据hexo clean# 生成hexohexo g# 重新启动hexo s

四:博客免费部署到github上去

1.在github上新建一个repository

npm install hexo-deployer-git --save

2.使用UltraEdit打开"_config.yml",打开页面如下:

2.1.更改(每个冒号后面要有一个空格):

2.2. 输入:

# 提交账户git config --global user.email "smiles2011hyc@gmail.com"git config --global user.name "smiles2011hyc"hexo d

点击“sign in with your brower"

点击 “Authorize GitCredentialManager"

2.3. 博客部署页面已经完成

输入网址:博客地址

2.4. 自定义一个hexo主题

git clone https://github.com/litten/hexo-theme-yilia.git themes/yiliacd themes\yiliadir

2.5. 修改_config.yml

修改theme下的主题:

hexo cleanhexo ghexo s# 推到远端即github中hexo d

参考视频:https://www.bilibili.com/video/BV1Yb411a7ty/?spm_id_from=trigger_reload

TAGS标签:  GitHub  如何  建立  网站  通过  github如何建立

Copyright © 2024 有趣生活 All Rights Reserve吉ICP备19000289号-5 TXT地图HTML地图XML地图