Hexo NexT Theme Configuration
Install NexT theme
First, you need to install the NexT theme, you can enter the following code:
1 | npm install hexo-theme-next |
![](/images/Hexo-Next-Theme-Configuration/install_next.png)
Local search function
Install the following plug-ins:
1 | npm install hexo-generator-searchdb --save |
Add the following code to Hexo _config.yml:
1 | search: |
Then, you need to open the local search function in NexT _config.yml:
![](/images/Hexo-Next-Theme-Configuration/local_search.png)
Now, you can see this on your website:
![](/images/Hexo-Next-Theme-Configuration/search.jpg)
Article excerpt
Install hexo-excerpt via cmd:
1 | npm install hexo-excerpt --save |
Then, Add the following code to Hexo _config.yml:
1 | excerpt: |
Now, you can see the "Read More" button on your website:
![](/images/Hexo-Next-Theme-Configuration/read_more.jpg)
Code block theme
You can change the background color of the code block here in NexT _config.yml, and there are many themes at https://theme-next.js.org/highlight/.
![](/images/Hexo-Next-Theme-Configuration/codeblock.png)
Article word count and reading time
Install hexo-word-counter via cmd:
1 | npm install hexo-word-counter |
Then, add the following code at the end of the Hexo _config.yml:
1 | symbols_count_time: |
Finally, modify the NexT _config.yml:
![](/images/Hexo-Next-Theme-Configuration/symbols_count_time.png)
Comment system
We can implement a comment system based on Gitalk. It saves article comments in the specified Github repository in the form of issues.
![](/images/Hexo-Next-Theme-Configuration/Register_OAuth.png)
First, you need to register a new OAuth application: https://github.com/settings/applications/new
Then, you need to edit the configuration in the NexT _config.yml as follows:
![](/images/Hexo-Next-Theme-Configuration/git_talk.jpg)
If you don’t want to display the comment module on a certain page, you can add the following code to the Front-matter of the page:
1 | comments: false |
Note that if you close an issue on your Github, you will not see the corresponding comments on the website.
Copyright notice
If you want to add a copyright notice at the bottom of the article, you need to modify the code here:
![](/images/Hexo-Next-Theme-Configuration/license.png)
Then, you can see a similar copyright statement at the bottom of the article:
![](/images/Hexo-Next-Theme-Configuration/show_license.png)
For more information about copyright agreements, you can visit this website: https://creativecommons.org/share-your-work/cclicenses/
Douban data display
If you use Douban to record the movies or books you have watched, you can use the hexo-douban plug-in to display your data.
Install hexo-douban via cmd:
1 | npm install hexo-douban --save |
Then, Add the following code to _config.yml:
1 | douban: |
Finally, use the following code to update your website:
1 | hexo clean |
Note that you can also use other parameters here instead of hexo douban -m
, such as:
1 | -b, # books, Generate douban books only |
More information about the parameters can be found here: https://github.com/mythsman/hexo-douban
Now you can see your Douban data on your website:
![](/images/Hexo-Next-Theme-Configuration/movie_data.png)