github+hexo build blog (2)

  • 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

  1. How to successfully build a github+hexo personal blog in github+hexo building a blog (1)
  2. 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
  3. First switch to your blog directory and use the cd command

Enter image description

  1. 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
  1. 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)

Enter image description

  1. Then go back to git bash and enter the debug command
$ hexo server --debug
  1. At this time, enter localhost:4000 in the browser, you will see that the theme style has changed

Enter image description

  1. 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
  1. If you choose the NexT theme, you can check the official website NexT , related configuration and usage methods, including third-party services
  2. 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.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325475384&siteId=291194637