Hexo v4.2.1 Release Notes

Release Date: 2020-05-14 // 24 days ago
  • 🚀 Before 4.2.0, Hexo does not work with Node 14. This is a patch release for support Node 14.

    🛠 Fix

    • chore: incompatible with Node 14 [#4285]
      • chore(deps): bump hexo-util from 1.8.0 to 1.9.1
      • chore(deps): bump hexo-util from 2.0.0 to 2.0.1

Previous changes from v4.2.0

  • 🔋 Features

    • 0️⃣ Caching is disabled by default in hexo-server [#3963]

      • It's disabled so that any changes (particularly to the theme's layout) can be previewed in real-time.
      • If you use hexo-server in production environment to serve your website, it can be enabled by,

      _config.ymlserver: cache: true

    • ➕ Add min_depth: option to toc() helper [#3997]

      • Example usage:

      <%- toc(page.content, { min_depth: 2 }) %>// table of content would only include <h2>, <h3> and above

    🛠 Fixes

    • 🔀 Merges similar theme configs in main config and theme's config [#3967]

      • For example:

      _config.ymltheme_config: a: b: 'foo'

      • Plus,

      _config.yml of themea: c: 'bar'

      • theme variable should have,

      a: { b: 'foo', c: 'bar' }

    • 🛠 Fixes some caching issue [#3985]

    • 🔧 Open Graph now applies all pretty_urls options to og:url tag [#3983]

    ♻️ Refactor

    No longer uses lodash [#3969], [#3987], [#3753]

    • Lodash _ is still available as a global variable, usually utilized in theme layout.
    • However, we plan to completely drop it in the coming Hexo 5.0.0

    - This project page includes all the relevant pull requests which you may find useful

    Completely drops cheerio [#3850], [#3677]

    • This means Hexo no longer includes cheerio as part of its production dependencies (it's still a development dependency)
    • This also means the following initialization methods no longer work,

      const cheerio = require('./node_modules/hexo/node_modules/cheerio/index')const cheerio = require('./node_modules/cheerio/index')

    • To use cheerio,

      $ npm install --save cheerio

      const cheerio = require('cheerio')