- background:
- After building a personal blog on github+hexo, you will find that the default theme is not your favorite, so you want to change the blog theme
Change blog theme
- How to successfully build a github+hexo personal blog in github+hexo building a blog (1)
- When visiting a personal blog, you will find that the default theme is not good-looking, and you want to change its theme. At this time, we can choose the one you like from the 195 themes in the Hexo theme address , or know the topic: What are there? Nice looking Hexo theme? to pick your favorite theme
- First switch to your blog directory and use the cd command
- Use the clone method to download the desired theme (I am using the NexT theme here)
$ git clone https://github.com/theme-next/hexo-theme-next themes/next
- Open the _config.yml configuration file in the blog directory
- Find the configuration option of theme and configure the theme option to our newly downloaded next theme. (Remember!!! ":" The space after the colon is indispensable)
- Then go back to git bash and enter the debug command
$ hexo server --debug
- At this time, enter localhost:4000 in the browser, you will see that the theme style has changed
- After the local view is correct, enter the generate and publish commands, and the new theme can be published on your own blog website.
$ hexo generate
$ hexo deploy
- If there is an exception caused by the cache, you can execute the clear cache command before generating the command
$ hexo clean
- If you choose the NexT theme, you can check the official website NexT , related configuration and usage methods, including third-party services
- About configuring the blog language, modify the language option in the _config.yml file. Pay attention to refer to the theme configuration documents or instructions you use before modifying to prevent deviations.