sword

使用github搭建动态的个性化博客
前言本文介绍使用github gist api 无需任何服务器,搭建一个可动态发布文章的个人博客,博客基于 Git...
扫描右侧二维码阅读全文
29
2018/07

使用github搭建动态的个性化博客

前言

本文介绍使用github gist api 无需任何服务器,搭建一个可动态发布文章的个人博客,博客基于 GitHub Pages 与 Github API 实现无后台,可动态发布博客的系统。博客数据储存于gist 通过Github API 进行增删改查。
演示地址:https://github-laziji.github.io
Github地址:https://github.com/GitHub-Laziji/vblog

请输入图片描述

快速搭建

搭建博客只需3步

1、点击github头像旁边的 "+" 号 选择 Import repository克隆地址填 https://github.com/GitHub-Laziji/GitHub-Laziji.github.io 项目名填:你的用户名.github.io
2、克隆完成后 修改文件 /static/configuration.json 中的 githubUsername 为自己的github用户名
类似演示地址其中 GitHub-Laziji 为用户名

现在 https://你的用户名.github.io 就是你的个人博客了,例如https://github-laziji.github.io(可能需要等一两分钟,并按F5强制刷新才能出来)

3、获取Token并绑定
发布文章和修改博客某些设置需要绑定token,在 github > settings > Developer settings > Personal access tokens 勾选gist 和 repo权限,获取Token,点击博客左下角绑定。

绑定自定义域名

如果你想用Github二级域名访问,就无视这一步,如果你想用自己的域名访问,请继续看。

先解析域名的CNAME记录到你的Git二级域名
请输入图片描述

然后访问你的博客Git项目地址,点击Create new file新建文件,命名CNAME,内容写上你的域名,不要http等。

请输入图片描述
请输入图片描述
稍等一会儿后就可以通过自己的域名访问博客了

Last modification:August 27th, 2018 at 10:01 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment

3 comments

  1. Geekln   ( Windows 10 x64 Edition Windows 10 x64 Edition / Google Chrome 68.0.3440.106 Google Chrome 68.0.3440.106 )

    不支持php啊

    1. 呵呵哒萌萌哒   ( Windows 7 x64 Edition Windows 7 x64 Edition / Google Chrome 68.0.3440.106 Google Chrome 68.0.3440.106 )
      @Geekln

      没听懂啥意思,这明明就是在github上的,怎么不支持

  2. 邱憨包   ( Windows 10 x64 Edition Windows 10 x64 Edition / Google Chrome 67.0.3396.99 Google Chrome 67.0.3396.99 )

    可以试试.