github-Pages提供一个用来搭建静态网站的服务,一般可用于自己的博客。

一、起步

创建一个git仓库:Create a new repository

仓库名为:username.github.iousername : 为你的github用户名。

如图:

github-pages-demo

一定记得把username改成你的github用户名!

比如我的用户名是vimplus,同理仓库名就是vimplus.github.io
然后点击Create repository完成仓库创建。

二、上手

将刚刚创建的仓库git clone到你的本地,例如我的:

$ git clone https://github.com/vimplus/vimplus.github.io.git

使用编辑器添加一个index.html,内容为:

<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
</head>
<body>
    <div>Hello, World!</div>
</body>
</html>

保存完了之后推送到你的git仓库,在地址栏输入:https://vimplus.github.io,搞定!

拓展阅读

github-Pages官网

相关标签