github hexojs/hexo 4.2.0

latest releases: v7.2.0, v7.1.1, v7.1.0...
4 years ago

Features

  • 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.yml
    server:
      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.yml
    theme_config:
      a:
        b: 'foo'
    • Plus,
    _config.yml of theme
    a:
      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')

Don't miss a new hexo release

NewReleases is sending notifications on new releases.