hexo-theme-next主题安装

NexT主题安装

  1. 安装完 hexo 之后,进入blog目录,用 npm 方式安装
1
2
$ cd hexo-site
$ npm install hexo-theme-next
  1. _config.ymltheme配置项修改为next
1
theme: next
  1. 使用hexo clean && hexo s进行测试,查看主题是否应用成功。

  2. next theme 配置文件路径

1
ode_modules/hexo-theme-next/_config.yml

使用npm install hexo-theme-next@latest来安装最新的NexT主题,主题会安装到node_modules中,也可以使用cp -r node_modules/hexo-theme-next/* themes/next/复制主题到themes目录。

配置文件

  • hexo 5.0+,官方推荐_config.yml同级目录下创建主题配置文件_config.[name].yml,这种方式不用去修改next主题下的_config.yml文件,需要什么配什么。

  • 我们使用cp node_modules/hexo-theme-next/_config.yml _config.next.yml复制默认的next配置文件

我们强烈建议你将所有的主题配置集中在一处。如果你不得不在多处配置你的主题,那么这些信息对你将会非常有用:Hexo 在合并主题配置时,Hexo 配置文件中的 theme_config 的优先级最高,其次是 _config.[theme].yml 文件,最后是位于主题目录下的 _config.yml 文件。