My blog: https://linbojin.github.io/
- Github account: blog deployed by GitHub Pages
- Hexo: blog framework to generate static blog files
- MWeb: Markdown writing tool
- Create a new repository named username.github.io
- https://username.github.io will be your personal blog address
Make sure you have installed node.js and git.
$ npm install -g hexo-cli
$ hexo init blog
$ cd blog
$ hexo new "my first blog"
- Install MWeb in App Store
- Lauch MWeb and go into
External Mode
(Command + E) - Add new external source:
{blog}/source
, and chooseMedia Save Path
asAbsolute
- Enjoy writing
-
Install hexo-deployer-git
$ npm install hexo-deployer-git --save
-
Edit
{blog}/_config.yml
$ vim _config.yml # Deployment deploy: type: git repo: git@github.com:username/username.github.io.git branch: master
-
Deploy after you make any changes and go to your blog https://username.github.io
$ hexo deploy -g
-
You can also test local: http://0.0.0.0:4000/
$ hexo server
-
Back up
source
folder and add version control: markdown source files will be inside{blog}/source
and this folder will not be tracked by git. So I sync this important folder to cloud:$ cp -r {blog}/source {Dropbox}/blog/source $ vim _config.yml # point source_dir to the new synced path # Directory source_dir: {Dropbox}/blog/source
-
Add README.md to repo: create README.md inside
{source}
folder and modify{blog}/_config.yml
, so that README.md can introduce your repo on github like this one:$ vim _config.yml # Directory skip_render: README.md
Ref: Hexo, MWeb for Octpress