选择hexo主题

image-20210315231312132

配置步骤

  1. 进入hexo管理文件夹(如Hexo系列(一)中提到的e:\hexo-blog

  2. 命令下载,即可在e:\hexo-blog\themes下找到下载的主题了

    1
    git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
  3. 修改e:\hexo-blog\_config.yml中的theme: landscape改为theme: butterfly,即修改为主题对应文件夹,并把e:\hexo-blog\themes\butterfly\_config.yml复制到e:\hexo-blog下并重命名为_config.butterfly.yml,以后大部分配置只需要在_config.butterfly.yml修改即可。

  4. 未避免出错,执行以下命令重新进行生成,并开启本地服务,成功显示见步骤6,若网页不能正常显示(显示为一串英文),见步骤5

    1
    2
    3
    hexo clean # 清除缓存(删除已生成的public文件)
    hexo g # 生成文件
    hexo s # 开启本地服务
  5. 使用以下命令安装pug以及stylus的渲染器

    1
    2
    # 在cmd或git for windows下进行安装,命令输入路径为e:\hexo-blog
    npm install hexo-renderer-pug hexo-renderer-stylus --save
  6. 成功显示如下所示,可以看到和官方显示效果有所差异

image-20210315232618112

  1. 详细主题配置介绍,参见官方文档