4.2.0
版本发布时间: 2019-12-22 18:10:38
hexojs/hexo最新发布版本:v7.3.0(2024-07-01 22:41:17)
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 totoc()
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 toog: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
- Lodash
-
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')