git教程六:在github上创建一个页面
官方文档 创建的页面URL和https://vmo-fed.github.io/类似,github.io结尾表示我们的页面是托管在github上的。
创建方式有2类
- 直接在用户名下创建或者创建一个组织然后在组织里创建站点
创建站点
- 直接在用户名下创建
- 打开https://github.com/new新建一个仓库,Repository name写你github的名字
- 在命令行执行
我们给index.html里添加内容$ git clone https://github.com/username/username.github.io $ vi index.html $ git add index.html $ git commit -m 'add index.html' $ git push
hello br
,访问https://username.github.io结果如下 - 打开https://github.com/new新建一个仓库,Repository name写你github的名字
- 在组织下创建站点
- 访问创建组织链接
- 创建组织名
给已有的项目创建博客页面
- username文件添加博客页面
- 点击setting
- 点击pages theme
- 选择主题,然后生成tooken
- 创建一个文件夹react,在里面新建index.md,然后提交
- 访问https://xxx.github.io/react
- 点击setting
- 已经存在的项目添加博客页面
- 已有仓库点击新建
- 创建index.html
git + hexo搭建博客
$ npm i -g hexo
$ mkdir hexo-blog
$ cd hexo-blog
$ hexo init
$ hexo s
$ hexo d
$ hexo new xxx
$ hexo d
hexo init
初始化hexo
hexo s
启动本地服务
hexo d
编译上线
hexo new xxx
生成新的文件