Is Hexo awesome? Static website construction and maintenance

Posted by Kuihao on 2022-04-04
Estimated Reading Time 1 Minutes
Words 223 In Total
Viewed Times

Static website Hexo

Hexo is a static website framework that helps authors quickly build professional-looking blogs
Hexo’s articles are written in markdown syntax
Reference: Try to learn Hexo

Environmental Construction

  1. Install nvm

    NVM: Node.js Version Manager

  2. nvm install Node.js
    1
    nvm install latest 64
  3. nvm activate node.js
    • Normal Activation:
      1
      nvm on
      The following message is displayed to indicate normal activation:
      1
      2
      nvm enabled
      Now using node v17.8.0 (64-bit)
    • troubleshooting:
      Use command nvm on or nvm use latest 64, but show up:
      1
      exit status 1: �s���Q�ڡC
      This is due to insufficient privileges, please open it with administrator privileges.
  4. View the node.js version after nvm is activated
    1
    node --version
  5. nvm install Hexo
    1
    npm install -g hexo-cli
  6. View Hexo version
    1
    hexo -v

Start Hexo

  1. Buold Hexo website project
    Generate hexo web directory in current directory
1
hexo init <myblog: DirName>
  1. Create the first article
1
hexo new "first-artical"

You can see the first-artical.md generated in the source/_post directory

Preview blogs: Hexo compilation, built-in Web Server, and other important commands

Ref.: The Hexo command you can’t forget

  1. Compile and generate web files
    1
    hexo generate
  2. Activate Hexo web server
    1
    hexo server
  3. Other abort and clear related commands
    Clear cache files: Clear cache files (db.json) and compiled files (public)
    1
    hexo clean