github如何建立网站(通过GitHub免费构建个人网站)
- 注册GitHub账号
- 登陆GitHub账号,点击"Your repositories"
- new一个新的repositories,如下图填写:
二:安装node.js
- 下载node.js (Node.js);
2. 安装cnpm
# 选用淘宝镜像下载
npm install -g cnpm --registry=https://registry.npm.taobao.org #安装失败可多次尝试
cnpm
cnpm -v
3. 安装hexo-cli
cnpm install -g hexo-cli
hexo -v
D:
cd Iblog
chdir
## 必须先安装git
hexo init
4. 启动博客
hexo s
# INFO Hexo is running at http://localhost:4000/ . Press Ctrl C to stop.
三:上传博客
#新建博客
hexo n "我的第一篇博客文章"
cd source/_posts
dir
cd ../../
# 清理数据
hexo clean
# 生成hexo
hexo 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/yilia
cd themes\yilia
dir
2.5. 修改_config.yml
修改theme下的主题:
hexo clean
hexo g
hexo s
# 推到远端即github中
hexo d
参考视频:https://www.bilibili.com/video/BV1Yb411a7ty/?spm_id_from=trigger_reload
,免责声明:本文仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。文章投诉邮箱:anhduc.ph@yahoo.com