https://zhuanlan.zhihu.com/p/35668237 http://lijiankun24.com/Mac下Hexo和GitHub-Pages搭建个人博客1/ https://blog.csdn.net/dajian790626/article/details/78595684
http://thinkdevos.net/2017/09/21/使用Hexo搭建自己的博客,托管到GitHub-Pages/
1. 新建repository;
2. repository name格式必须为:username.github.io,后缀必须是github.io,username为GitHub用户名;
3. 勾选init with a README;
4. 创建后,settings,GitHub Pages,Source-->master branch,Theme chooser-->第一个默认的;
1. npm install -g hexo
2. hexo -v 验证,若command not found,配置环境变量(~/.bash_profile;hexo的bin,安装日志有输出;)
https://github.com/YenYuHsuan/hexo-theme-beantech
1. 按说明(init):
git clone https://github.com/YenYuHsuan/hexo-theme-beantech.git ./hexo-beantech cd hexo-beantech npm install2. 修改根目录下的_config.yml文件,在这里配置各种博客信息,如下做必要的修改:
2.1 文件末尾,deploy部分:
deploy: type: git repository: https://github.com/bigsherry/bigsherry.github.io.git branch: master2.2 注释# Note: don't forget to modify the CNAME file to your url,所在行,url不合法,发布后GitHub会给你发邮件,改成 http://yoursite.com 类似,不改也不影响使用;
npm install hexo-deployer-git -save
按输出提示,访问 http://localhost:4000/,就能看见博客,停止服务使用 Ctrl+C
1. hexo d
2. 发布之后,大概10s左右,会更新
3. 访问 https://bigsherry.github.io
1. hexo new post "article title",article title为新文章标题;
2. 之后项目根目录/source/_posts目录下,多处一个同名目录和.md文件,前者可放置文章引用图片,后者即markdown文件(Mac版markdown编辑器推荐:https://typora.io/)文章内容引用本地图片(图片view.jpg已放置在同名目录下),语法如下:
3. 写完hexo g; hexo d; 发布即可;
1. _config.yml能做的修改:title、subtitle、author(影响底部的copyright)、language(简体中文:zh-Hans)、SEOTitle、email、friends标签、社交账号(注释掉即可)等;
2. 图片替换:(我有一个大胆的想法),不用改配置,用同名文件替换;
例如,去掉封面右下角签名:用一个同名空png代替签名图片;
封面图片基本都在:根目录/source/img目录下;
3. 回到top logo:在css目录下;
4. header anchor 'ℬ'符号修改,官网上有,theme目录下,layout/post.ejs;
5. 去掉右上角archive和about链接:删除source目录下的archive和about目录;
1. 环境搭建
安装node、npm、git、hexo、hexo-deployer-git
下载博客源码:git clone -b source https://github.com/bigsherry/bigsherry.github.io.git
2. 本地测试
本地预览、同步源码、发布文章、提交更新源码