使用Hexo搭建博客框架

2020-09-14  本文已影响0人  酵母小木

To record some basic operations about Hexo and test some new ideas, I decided to create a blog again!

1. Build the website

  1. Enter the user’s content:

    $  cd ~/
    
  2. Creat a new folder to store the website:

    $  mkdir BlogTest    
    
  3. Enter the Website’s content:

    $  cd BlogTest
    
  4. Install the Hexo into the folder: (If you have done this, skip it)

    $  npm install -g hexo
    
  5. Build a new website:

    $  hexo init
    
  6. Build the content:

    $  npm install
    
  7. Build a new Blog:

    $  hexo new "title"        
    
  8. Generate the static files:

    $  hexo generate
    
  9. Start server: (Website: http://localhost:4000/)

    $  hexo server 
    

And in the end of this, you will find as follows:

deploy

Note that the colon is followed by a space. Then you can deploy your website from local to Github.

Common commands

  1. Generates static files

    $ hexo generate
    
  2. Deploy the website

    $  hexo deploy
    
  3. Cleans the cache file (db.json) and generated files (public).

    $  hexo clean
    
  4. List sources in this website

    $  hexo list
    
  5. Show the hexo’s version

    $  hexo version
    

I just want to record some common operations that I will use usually. Hope it can help you. If you want to know more, you can visit the Commands.

References

  1. 官方文档.
  2. Mac下使用Hexo和Github搭建静态博客
上一篇 下一篇

猜你喜欢

热点阅读