为何要搭建我的博客?本人是一个没钱没颜的小哥哥,人生中最大的乐趣就是白嫖。可是,做为一位有着一腔热血、热爱学习的青年,找不到合适记笔记的地方(映像笔记、有道云都还能够,推荐你们去看看,滑稽.png)。无心中萌发搭建博客的想法,因此写了这篇博客(第一篇博客,想一想仍是很激动的,尽管没人看)。node
Hexo 是一个快速、简洁且高效的博客框架。Hexo 使用 Markdown(或其余渲染引擎)解析文章,在几秒内,便可利用靓丽的主题生成静态网页。git
username.github.io
[ username
为 github 用户名]git config --global user.name "John Doe" git config --global user.email johndoe@example.com
npm install -g hexo-cli
hexo init localBlog
初始化该站点(速度有点慢,耐心等待一下)cd <folder> //进入站点 npm install //安装相关模块
hexo server //hexo server 等价于 hexo s //在浏览器输入 http://localhost:4000
title: 海棠的我的博客 subtitle: 副标题 description: 网页描述 author: 海棠 language: zh-CN timezone: Asia/Shanghai
url: https://haitany.github.io
deploy: type: git repo: https://github.com/Username/username.github.io.git branch: master
git bash
客户端cd ~/.ssh ls
ssh-keygen -t rsa -C "你的注册邮箱"
clip < ~/.ssh/id_rsa.pub //至关于复制该文件里的内容
Settings
进入,而后点击菜单栏的 SSH key 进入页面添加便可。测试一下 SSH key 是否正常?git bash 输入
ssh -T git@github.com
而后输入yes
知道看见 successfully authenticated 字样而不是 access denied 字样则证实 SSH key 链接正常。github
hexo new "文章名"
系统会在 source 下的 _post 里生成一篇 md 文件,而后你就能够尽情发挥了。hexo g //生成静态页面 hexo s //本地预览 hexo d //一键部署
该过程首次进行可能会提示须要登录 github 及 OpenSSH若是过程提示 ERROR: deploy don't find git ! 则须要执行
npm install hexo-deployer-git --save
shell
关于启用资源(Asset)文件夹,这里就不做详细介绍 ! ! !