0基础使用Github搭建个人博客(菜鸟向)
2019-02-17 本文已影响163人
DayBreakL
为什么是菜鸟向
在此之前便久闻Github大名,全球最火热的基佬交友网站,如今我也是从0学起。
经历从啥都不懂到搭建起个人网站。一个字,干!
什么是Github
Github,网址:https://github.com,是一个软件源代码托管服务平台。截止到2015年,GitHub已经有超过两千八百万注册用户和7900万代码库,可以说是世界上最大的代码存放网站和开源社区。
可以用Github做什么
有人在上面写blog,有人在上面写书,可以follow大牛,可以提升自己,可以写简历……
一、注册一个github账号
-
点击Sign up进行注册:
image.png
-
创建一个账号
image.png
-
真人验证
image.png
-
各种下一步
image.png
-
进入自己的主页
image.png
-
邮箱认证
image.png
image.png
image.png
二、github名词解释
仓库:repository,存放代码,可以理解一个项目为一个仓库
fork:Fork某个人的仓库,会复制他的仓库(包括文件,提交历史,issues,和其余一些东西),复制后的仓库在你自己的GitHub帐号下
三、搭建个人博客
(1)创建一个仓库


创建好后,访问:https://daybreakl.github.io/

(2)下载github desktop
下载地址:https://desktop.github.com/
(3)登录自己的github账号,克隆自己的仓库


(4)选择、下载主题
在http://jekyllthemes.org/中挑选自己中意的主题,jekyll是一个简单的免费的Blog生成工具


(5)应用主题
先删除掉除.git文件夹的其他文件

把下载的主题模板里的文件复制进来

- index.html:博客主页的内容
- _config.yml:博客的基本配置文件,里面有博客的名字、存放博主的一些基本信息
- _layouts:这文件夹里面存放你每个页面的设计,一般有default.html(默认页面)和posts.html(博文页面)
- _includes:这个文件夹里的的内容将会通用到你博客每个页面
- _posts:这里面就是博文啦,必须用markdown语法写
(6)上传到github
changes是本地发生变化的数目

在Summary中填写此次提交内容的概述,点击Commit to master
点击fetch origin
(7)访问博客
上传成功后,访问https://daybreakl.github.io/
之后在_posts 中撰写博文,上传即可