1.购买域名
阿里云的域名,购买域名注册后,云解析不是立马就有效,第一次弄这个注册完域名就开始动刀,但是在GitHub上无论怎么设置都解析不到域名,两三个小时后才可以正常使用,我购买的阿里云的域名roebay.cn
,正常图示如下:
2.设置域名解析
ping你的http://github.io
(ping 用户名.github.io)域名,得到一个IP(151.101.73.147),设置如下图所示
3.建立GitHub仓库
注意一定要以Github用户名开头,如xxx.github.io
,在repository中添加CNAME
文件,内容为roebay.cn
,在Website
中添加链接地址http://roebay.cn
4.链接到CSDN
在repository中添加index.html
,并添加如下内容,即可链接到CSDN博客
<script>
window.location.href="https://blog.csdn.net/xxx"
</script>