Requirements
Github account: blog deployed by GitHub Pages
Hexo: blog framework to generate static blog files
MWeb: Markdown writing tool
Setup Github
- Create a new repository named username.github.io
- https://username.github.io will be your personal blog address
Setup Hexo
Make sure you have installed node.js and git.
|
|
Setup MWeb
- 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
Deploy Blog
Install hexo-deployer-git
1$ npm install hexo-deployer-git --saveEdit
{blog}/_config.yml
1234567$ vim _config.yml# Deploymentdeploy:type: gitrepo: git@github.com:username/username.github.io.gitbranch: masterDeploy after you make any changes
1$ hexo deploy -gYou can also test local: http://0.0.0.0:4000/
1$ hexo server
Tips
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:12345$ cp -r {blog}/source {Dropbox}/blog/source$ vim _config.yml # point source_dir to the new synced path# Directorysource_dir: {Dropbox}/blog/sourceAdd 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:1234$ vim _config.yml# Directoryskip_render: README.md
Ref: Hexo, MWeb for Octpress