2019.30.16 <玩转> Github Pages

https://pages.github.com/
实例:https://psicmi.party

国内虽有gitee,但是自定义域名在短暂的体验期过之后就会失效。而GitHub不仅可以自定义域名,而且免费、支持个人Project。

建repository

repository命名规则:username.github.io ,这里的username可以是自己的username,也可以是organization name

例如,我建立了一个organization,名字叫psicmi,那我可以建立一个repository,名字为psicmi.github.io

增加index.html文件

我使用LinuxMint系统,使用terminal方便,那接下来clone该repository到本地

git clone https://github.com/psicmi/psicmi.github.io

进入目录,并增加index.html(只能是index.html),然后commit & push.

cd psicmi.github.io
echo "Hello World" > index.html
git add all
git commit -m "init index.html"
git push origin master

稍等片刻,即可访问 https://psicmi.github.io

绑定自定义域名

浏览器访问 https://github.com/psicmi/psicmi.github.io, 然后在 Setting 中找到Custom domain处填写自己的域名,我使用的是 psicmi.party, 且可以设置强制https访问。

设置完成之后可访问 https://psicmi.party 可看到同样效果。

注意:
1.绑定自定义域名需要在你的域名服务商那里配置CNAME解析!
2.页面等可以使用hexo或jekyll等,还有相关theme可以选择,是个做博客的好选择!

domain verify

绑定域名之后,可以配置同域名的邮箱地址,验证后可以将organization和domain做verify,看起来更像那么一回事 :)