什么是GitHub.io
GitHub.io 就是GitPage,GitPage 是一个用于展示你的项目和项目网站的托管工具。
简言之我们可以把项目介绍,主页等放到GitHub.io上。
我们能在GitHub.io上做什么
GitHub.io可以存放 .html 文件来展示网页,可用于项目主页也可以搭建个人博客。
例如 Hello World
GitHub.io也可以作为你自己的图床,上传一张图片到仓库,并生成一个远程链接。
例如 测试图片
如何使用GitHub.io
1.首先我们需要拥有一个 GitHub 账号;
2.登录我们的GitHub账号进入主页;
3.选择创建项目;
![](https://img.haomeiwen.com/i3500675/130e643791021e5b.png)
4.创建一个仓库,仓库名必须以 username.github.io 命名;
![](https://img.haomeiwen.com/i3500675/23b6755b7bf94bd7.png)
5.Clone 你的仓库到本地;
git clone https://github.com/username/username.github.io
6.创建主页;
cd username.github.io
echo "Hello World" > index.html
![](https://img.haomeiwen.com/i3500675/b1f4361798e9055e.png)
7.上传仓库;
git add --all
git commit -m "Initial commit"
git push -u origin main
![](https://img.haomeiwen.com/i3500675/bf2b87347988f4f9.png)
8.打开你自己的主页,在浏览器中输入;
https://username.github.io
![](https://img.haomeiwen.com/i3500675/38edfff0e185154d.png)
9.同理GitHub.io也可以用作图床,在项目中创建好图片文件夹,并放入一张图片;
![](https://img.haomeiwen.com/i3500675/7ed409fb8c986758.png)
10.在浏览器中输入对应的链接就OK啦。
https://notlovelychild.github.io/imgs/test.jpg
![](https://img.haomeiwen.com/i3500675/92dfec2c07abb286.png)
网友评论