Set Up Your Hexo Website
Wanna make your first blog? I recommend using hexo to build your blog! In Hexo, All features of GitHub Flavored Markdown are supported. You can even use most Octopress plugins in Hexo, and Node.js brings you incredible generating speed.
What you need
I recommend using Typora to edit markdown files.
Install Hexo
1 | $ sudo npm install -g hexo-cli |
Create a project for your GitHub Pages
1 | $ hexo init [githubaccount].github.io |
Run a test server for your page on Mac
1 | $ hexo server |
Set information for your new blog
https://hexo.io/docs/configuration.html
1 | $ vi _config.yml |
Set information to use Git
https://github.com/hexojs/hexo-deployer-git
1 | $ npm install hexo-deployer-git --save |
Set “watch” before starting your work
“watch” command can monitor your files.
https://hexo.io/docs/generating.html
1 | $ hexo generate --watch |
Create a new post file
1 | $ hexo new first-post |
Edit the above file with Markdown or Hexo’s Helper
Hexo’s Helper
https://hexo.io/docs/helpers.html
I use Atom with “shift + control + m” when I use Markdown :-)
https://atom.io/
Delete “source/_posts/hello-world.md”
It’s not necessary to deploy.
Deploy your new blog!!
https://hexo.io/docs/deployment.html
1 | $ hexo clean |
After writting the above command, you can see your new blog on GitHub Pages.
http://******.github.io/
Change your blog theme
https://github.com/hexojs/hexo/wiki/Themes
1 | For instance, How to use the following theme. |
Create a new page file
https://hexo.io/docs/writing.html
1 | $ hexo new page aboutme |
Use “Read More”
Write <!-- more -->
in your articles. <-Only For Certain Themes
Use Plugins
https://github.com/hexojs/hexo/wiki/Plugins
Quick Start
Short Cuts
hexo g == hexo generate
hexo d == hexo deploy
hexo s == hexo server
hexo n == hexo new
Create a new post
1 | $ hexo new "My New Post" |
More info: Writing
Run server
1 | $ hexo server |
More info: Server
Generate static files
1 | $ hexo generate |
More info: Generating
Deploy to remote sites
1 | $ hexo deploy |
More info: Deployment
Refresh your blog
Short Cuts
1 | $ hexo clean && hexo g && hexo d |
Reference
Useful Commands
Documentation Site
Troubleshooting Site
SetUp process
Forked from useHexo.md