In the NexT Upgrade, I list some upgrades can be done to create a better looking and more powerful site. During the process of digging, I also found some features or issues that’s not related to the theme NexT, but Hexo itself. Therefore, I moved out of the sections that’s only related to Hexo here.
The only file needs to be modified here is the _config.yml
and other files under root directory.
Sub Directory for Posts
I didn’t realize the directories under categories
were not properly organized. What I wanted is:
1 | |-GitHub |
However, it turned out to be like:
1 | |-GitHub |
And the problem is that I did not properly organized categories
in the source file, the proper way of constructing level of directory is using dash(-):
1 | categories: |
Then, the structure became:
1 | |-Hexo |
Rather than Hexo/NexT
Order Posts by Update Time
Change the order_by
to -updated
, now the articles listed in the home page is ordered by time updated rather than time created.
1 | # Home page setting |
Trim Command
Use short npm
command to run instead of long command such as hexo clean && hexo g && hexo d
. Add following scripts to package.json
:
1 | , |
Now, the long command can be replaced with npm run d
I do not recommend adding "hexo clean && hexo g && hexo s"
to "scripts"
.
I tried it, and it resulted prompt switch to new line after INFO Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.
information, and Ctrl+C
cannot strop server from running. It can be a problem if settings are modified, and the process needs to be restarted.
So I have to find the process running the port 4000, and force to kill it, then restart the server, which is more time consuming.
1 | # Find the pid of the process running in the port number (e.g., 8080) |