
拥有一个自己的博客, 是每个程序员的梦想. --- 鲁迅
已经记不起来, 这是我第几次折腾博客了.
前些次都是为了搭博客而搭博客, 以至于博客建完之后就再也不维护, 只有一篇"hello, world"放在那里丢人现眼, 真的是舍本逐末.

这一次不一样了!
我决定洗心革面, 认真更新内容.

为了把主要精力放到博客内容上, 我选择了用最简单的方式github pages
来搭建本博客.
下面开始正文.
1. 首先需要有一个github账号, 点击注册.
2. 新建一个仓库
例如: memeda.github.io
ps: github pages的仓库名字需要以github.io
作为结尾.

3. 设置仓库
点击"settings", 进入仓库设置页面.

找到"GitHub Pages"这一处, Source
选择master

选择之后, 你就会发现页面在进行刷新.
稍等片刻刷新完成. 再把页面滚动到此处, 你会看到一行提示, 类似于Your site is ready to be published at https://jzyzcz.github.io/memeda.github.io/.
其中的链接: https://jzyzcz.github.io/memeda.github.io/
就是你的博客地址.
点击此链接, 不出意外的话, 你的博客就呈现在你的眼前了.
4. 给博客绑定自己的域名
至此, 博客已经生成了, 非常简单的吧.

但是这个博客的域名太长了, 非常不容易让人记忆, 能不能改成自定义的域名呢?
肯定可以, 像下面这样操作就行了.
找到Custom domain
这一处, 在输入框内填写自己的域名, 例如: shumanman.mobi, 点击保存.
接下来需要去域名提供商那里进行域名的解析. 我的域名是在阿里云购买的, 此处就以阿里云为例.
登录阿里云控制台, 点击左侧的"域名".

找到你要绑定的那条域名, 点击解析:

类似下面, 新建两条记录:


记录类型选择CNAME
记录值填写你的仓库名称
点击保存就行了.
设置完之后, 过几分钟在浏览器输入你刚才设置的域名, 就可以访问你的博客了.
以上就是大致的设置过程.
如果你在设置的过程中, 遇到了什么问题, 可以邮件联系我.
最后, 祝大家国庆节快乐.
网友评论