Introduction#
When you visit the "Hexo official website," you will see a striking slogan:
A fast, simple & powerful blog framework
Hexo is a fast, clean, and efficient blog framework. Hexo uses Markdown (or other rendering engines) to parse articles and can generate static web pages with beautiful themes in seconds.
Installation#
Since Hexo needs to be built on Node.js and Git (please install Node.js and Git on your own), let's start the installation process.
# Install the Hexo scaffolding provided by Hexo
$ npm install hexo-cli -g
Running#
Next, initialize the project and run Hexo locally.
# Initialize the blog, which will generate a "blog" folder locally to store the project source code. You can name it anything you like.
$ hexo init blog
$ cd blog
# Install the dependencies for the project
$ npm install
# Start the blog
$ hexo server
INFO Start processing
INFO Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.
Now, open "http://localhost:4000" in your browser to see the Hexo default theme blog site.
Common Commands#
$ hexo n "myblog" # => hexo new "myblog"
$ hexo p # => hexo publish
$ hexo g # => hexo generate
$ hexo s # => hexo server
$ hexo d # => hexo deploy
Server commands for Hexo
$ hexo server # Hexo will monitor file changes and automatically update without restarting the server
$ hexo server -s # Static mode
$ hexo server -p 5000 # Change the port
$ hexo server -i 192.168.1.1 # Customize IP
$ hexo clean # Clear cache (can be ignored under normal circumstances)
$ hexo g # Generate static web pages
$ hexo d # Start deployment