My first post - Set my own blog
Hexo
Prepare - installation
Set up a new blog
1 | hexo init blog |
Start a local sever
run $ hexo server
server for drafts
- install plug-in
$npm install hexo-browsersync –save
$hexo server - -draft - -open
now my blog is hot reload athttp://localhost:4000/
Deploy my blog to Github
Create a new repository
Repostoryname: ownername.github.io
e.g JinWangQ.github.ioEdit
_config.yml
1
2
3
4
5
6# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type: git
repository: https://github.com/JinWangQ/JinWangQ.github.io.git
branch: masterInstall hexo-deployer-git
$ npm install hexo-deployer-git --save
Upload your site
$ hexo deploy
now http://jinwangq.github.io is available
Write a new post (what i am now doing ;D)
- Create a new post
$ hexo new "my first post"
- Edit
source/_posts/My-first-post
Markdown supported - Multiple tags
tags: [tag1,tag2,tag3]
Delete a post
- Delete the post from
source/_post
folder - Run
$ hexo clean
- Run
$ hexo generate
- Run
$ hexo deploy
Problems solving
Works well locally no style sheet after upload
- clear browsers cache
firefox
Preferences -> Privacy & Security -> Cookies and Site Data -> clear data
chrome
chrome://settings/clearBrowserData
Deploy once again
1
2
3$ hexo clean
$ hexo g
$ hexo d
- clear browsers cache
Reference
- Hexo
- Hexo搭建博客教程 by nMask