Hexo v5.0.0 Release Notes
Release Date: 2020-07-29 // over 3 years ago-
๐ฅ Breaking change
๐ refactor(external_link): migrate config during load_config @SukkaW [#4414] [#4371]
See Writing section for new options (introduced back in v4)
_config.ymlexternal_link: true|false # deprecated# New optionexternal_link: enable: true|false
_config.yml# https://hexo.io/docs/configuration#Date-Time-formatuse\_date\_for\_updated: true # deprecated# New optionupdated_option: date
If you check
external_link
for truthy value, since it's now automatically converted to object, it will be always truthy:<% if (config.external_link) { %>
If you wish to maintain backward compatibility with older Hexo versions:
<% if ((typeof config.external_link === 'boolean' && config.external_link === true) || (typeof config.external_link === 'object' && config.external_link.enable === true)) { %>
๐จ refactor(box): remove Bluebird.asCallback @SukkaW [#4379]
- Callback syntax for
Box
is never documented nor utilized in Hexo's internal.
- This is also a reminder that we might drop callbacks from all Hexo API in future. [#3328]
โก๏ธ feat: bring up config.updated_option @SukkaW [#4278]
- This can be useful for a theme that prefers to display
Updated:
only when it's set in the article's front-matter.feat(open_graph): drop 'keywords' option from front-matter @curbengh [#4174]
- Search engines no longer support
keywords
.๐ fix(#3464): override permalink use the front-matter @SukkaW [#4359]
User config:
_config.ymlpermalink: :year/:month/:day/:title/
Front-matter
---title: foo barpermalink: breaking-news/---
That post will be available on
http://yourhexo.com/breaking-news/
A reminder that permalink must have a trailing
.html
or/
permalink: :year/:month/:day/:title/ # default# orpermalink: :year/:month/:day/:title.html
โ Remove lodash from global variable @SukkaW [#4266]
- Lodash
_
is no longer available on Hexo API. // Dropped<% const arrayB = _.uniq(arrayA) %>
We encourage the use over native JS API over Lodash, we find this guide to be helpful.
- If you prefer to use Lodash, you can always install it and make it available via
Helper
APIchore/ci: drop Node.js 8 and add Node.js 14 @SukkaW [#4255]
- Node 8 has reached EOL on 31 Dec 2019.
- Hexo now requires Node 10+; although Node 10.x is still supported, but it's going to be officially deprecated in less than a year (April 2021), so we recommend Node 12+.
๐จ refactor: remove site config from theme config @SukkaW [#4145]
- Previously
hexo.theme.config
is merged intohexo.config
, they are now separated to avoid possible conflict in configuration.
๐ New feature
- feat(tag): show source of the error & beautify @SukkaW [#4420]
- ๐ feat(post_link): better error message when a post could not be located [#4426]
- The error message is now clearer when there is an incorrect filename.
๐ฑ skip assets of unpublished posts and delete them if exist @DaemondShu [#3489]
- When there is an unpublished post:
---title: Still a draft....published: false---
- That post including its assets will not be generated into the
public/
folder.
feat(extend/injector): bring up new extend Injector @SukkaW [#4049]
- Refer to the API documentation for usage.
๐ feat: add prism highlight support @SukkaW [#4119]
- Refer to the documentation for usage.
๐ feat(tagcloud): new option class & level @stevenjoezhang [#4370]
- Ability to add class name for CSS styling.
feat(config): validate config before processing posts @SukkaW [#4381]
feat(post_permalink): add
:second
attribute option for post permalink @kkocdko [#4185]- Example:
permalink: :year/:month/:day/:hour/:minute/:second/:title.html
- Refer to Permalinks for available attributes.
๐ feat(youtube_tag): add cookie option @curbengh [#4155]
- When disabled, cookie is not set/sent in the youtube video embed.
๐ feat(youtube_tag): support playlist @SukkaW [#4139]
- Ability to embed a playlist.
feat(load_theme_config): support alternate theme config @SukkaW [#4120]
- Theme can be configured in a file
_config.[name].yml
, e.g._config.landscape.yml
for hexo-theme-landscape. - Placed the file in the root folder, same as the current
_config.yml
. - Refer to the documentation for configuration priority.
- Theme can be configured in a file
๐ feat(feed_tag): support parsing config.feed @curbengh [#4029]
- Better integration with hexo-generator-feed.
feat(tag): add unregister() method @SukkaW [#4046]
- This means you can now unregister existing tag plugins and replace it with your own with the same name.
feat(filter): add
_after_html_render
filter @jiangtj [#4051]๐ feat(load_config): support theme_dir in node_modules @SukkaW [#4112]
๐ fix(list_tags): custom class for each element @noraj [#4059]
- Customize the class name for each element
<ul>
,<li>
,<a>
,<span>
for list_tags plugin.
- Customize the class name for each element
๐ Performance
- perf(tag): rendering optimization @SukkaW [#4418]
- perf(external_link): faster regexp & condition shorthand @SukkaW [#4436]
- โก๏ธ perf(external_link): optimize regex @SukkaW [#4008]
- perf(filter): shorthand syntax @SukkaW [#4377]
- perf(backtick_code): shorthand @SukkaW [#4369]
- ๐ perf: avoid running irrelevant plugins in 'clean' command @curbengh [#4386]
- To maintain compatibility with third-party console plugins, this only applies to
hexo clean
, nothexo c
alias.
- To maintain compatibility with third-party console plugins, this only applies to
- perf(titlecase): lazy require @SukkaW [#4417]
- ๐ perf(tag/code): performance improvements @SukkaW [#4416]
- perf(post): simplify codeblock escape @SukkaW [#4254]
- perf(meta_generator): avoid unnecessary check @SukkaW [#4208]
- perf(external_link): cache config @SukkaW [#4134]
- โจ perf(open_graph): avoid using htmlTag() and enhance cache @SukkaW [#4125]
- ๐จ refactor(list_archives): reduce calls to date.format() @dailyrandomphoto [#4011]
- ๐ fix(moment.locale): avoid lookup repeatedly with the wrong names @dailyrandomphoto [#4007]
๐ Fix
- ๐ fix(box): ignore .git and node modules in the theme folder @jiangtj [#4306]
- ๐ fix: allow empty title @stevenjoezhang [#4344]
- fix(#4236): don't create "/index" directories when post_asset_folder is true @jiangtj [#4258]
- ๐ fix(#4317): non-greedy regexp for tag escape @SukkaW [#4358]
- ๐ fix(post): use non-greedy regular expressions @stevenjoezhang [#4161]
๐ fix(post): properly escape swig tag inside post @SukkaW [#4352]
- swig tag inside a single backtick is now interpreted as code embed.
{% foo %}{{ bar }}{% endfoo %}
๐ fix(logging): log database only in relevant commands @curbengh [#4387]
Writing database to ${dbPath}/db.json
message shouldn't show up inhexo clean
andhexo version
.
๐ fix(server-cache): must match exact alias @curbengh [#4388]
- Improve compatibility with 3rd-party console plugins that may have a name that starts with an 's'.
๐ fix(tag-code): parse 'wrap' option @curbengh [#4391]
highlight.wrap
option in user config is now properly passed to thecodeblock
tag plugin
๐ fix: remove unused type check @Himself65 [#4398]
๐ fix: access error code from error object directly @SukkaW [#4280]
- Improve compatibility with native JS API
๐ fix(toc_helper): escape class name and handle null id @curbengh [#4009]
๐ fix(meta_generator): match existing
<meta>
with different order @SukkaW [#4017]๐ fix(excerpt): stricter regex @curbengh [#4443]
- Now only the following variants of excerpt tag are valid.
<!--more-->
<!-- more-->
<!--more -->
<!-- more -->
๐จ Refactor
- ๐จ refactor(meta_generator): no longer ignore empty @SukkaW [#4442]
- ๐ refactor(external_link): migrate config during load_config @SukkaW [#4414]
- โฌ๏ธ Reduce array#reduce @segayuu [#4299]
- Correct using createSha1Hash() with pipe() @seaoak [#4323]
- ๐จ refactor(post): reduce promise @SukkaW [#4337]
- ๐จ refactor: simplify code @2997ms [#4408]
- ๐จ refactor(external_link): filter regexp @segayuu [#4412]
- ๐จ refactor(hexo): merge theme_config before generation @SukkaW [#4360]
- ๐จ refactor(nunjucks): dedicated nunjucks renderer @SukkaW [#4356]
- ๐จ refactor: drop hexo-util#HashStream @SukkaW [#4279]
- ๐จ refactor(toc): avoid using htmlTag @SukkaW [#4183]
- ๐จ refactor(hexo_index): remove unused parameter @curbengh [#4153]
- ๐จ Refactor(class): Replace prototype to class syntax @segayuu [#4151]
- ๐จ refactor: copy object with spread operator @SukkaW [#4140]
- ๐จ refactor: simplify code @Himself65 [#4138]
- ๐จ refactor: utilize Object.entries @SukkaW [#4118]
- ๐จ refactor: utilize hexo-util pr-169 @SukkaW [#4045]
- ๐จ refactor(hexo/index): use Set @SukkaW [#4013]
- ๐จ refactor: Class syntax @SukkaW [#4100]
- ๐จ refactor(helper): minor changes @SukkaW [#4061]
- ๐ style: space for asyncArrow @SukkaW [#4102]
- โฌ๏ธ Reduce stream @segayuu [#4333]
Dependencies
- โก๏ธ chore(deps): update hexo-front-matter from 1.0.0 to 2.0.0 @SukkaW [#4439]
- โก๏ธ chore(deps): update hexo-util from 1.9.0 to 2.2.0 [#4276] [#4438]
- ๐ฒ chore(deps): bump hexo-log from 1.0.0 to 2.0.0 [#4392]
- chore(deps-dev): bump hexo-renderer-marked from 2.0.0 to 3.0.0 [#4390]
- chore(deps-dev): bump mocha from 6.2.2 to 8.0.1 [#4060] [#4354]
- โก๏ธ Update tester node version @segayuu [#4324]
- ๐ chore(deps-dev): bump eslint from 6.8.0 to 7.0.0 [#4301]
- chore(deps): bump warehouse from 3.0.1 to 4.0.0 [#4077] [#4322]
- ๐ chore(deps-dev): bump lint-staged from 9.5.0 to 10.2.0 [#4283]
- chore(deps): bump hexo-fs from 2.0.0 to 3.0.1 [#4277]
- chore(deps-dev): bump sinon from 7.5.0 to 9.0.2 [#4005] [#4232]
- chore(deps-dev): bump husky from 3.1.0 to 4.2.5 [#4235]
- chore(deps): bump chalk from 3.0.0 to 4.0.0 [#4215]
- chore(deps-dev): bump nyc from 14.1.1 to 15.0.0 [#4003]
Misc
- ๐จ refactor: port shell script to javascript @Himself65 [#4405]
- ๐จ refactor(console/generate): class & destructure assign @SukkaW [#4338]
- ๐ Fix not to pass callback to hexo-fs @segayuu [#4339]
- ๐ style: es6 string extensions & destructure @SukkaW [#4357]
- Migrate Travis and Appveyor tp GitHub Actions
- ci(appveyor): drop appveyor @SukkaW [#4402]
- chore: add release release-drafter (#3858) @YoshinoriN [#4165]
- ci: add GitHub Actions to run linter @Himself65 [#4143]
- ci(travis): remove Windows @curbengh [#4076]
- ci(github_actions): Create tester job @segayuu [#4169]
- Move coveralls from travis to github actions @segayuu [#4326]
- ci(benchmark): generate flamegraph @SukkaW [#4000]
- ci(flamegraph): fix 0x @SukkaW [#4116]
- ๐ Fix issues found by lgtm.com
- ๐จ refactor(benchmark): minor changes @SukkaW [#4411]
- github(issue_template): add special notice @SukkaW [#4348]
- add mandarin issue template
โ Test
- โก๏ธ test(benchmark): optimize for local & render post support @SukkaW [#4428]
- โ perf(mocha): run tests in parallel @curbengh [#4374]
- ๐จ refactor(test): async hexo/load_config.js @segayuu [#4340]
- โ test(#4087): add related cases @SukkaW [#4364]
- โ test(post): add test cases for [#3543] & [#3459] @SukkaW [#4361]
- โ test(generate): add a small delay before clean up @SukkaW [#4393]
- โ test(#4385): no double escape in code block @SukkaW [#4395]
- โ test(generate): add a longer delay after fs#unlink @SukkaW [#4400]
- โ test: coverage improvements @SukkaW [#4270] [#4421] [#4422]
- ๐ test(box): fix test cases for macOS @stevenjoezhang [#4269]
- โ test(load_plugins): make sure file is created @SukkaW [#4265]
- โ test(post): adding extra test cases @SukkaW [#4238]
- โ test(load_plugins): minor changes @SukkaW [#4212]
- โ test(post): fix cases added in #4161 @SukkaW [#4162]
- โ test(tags-plugins/helper): improve test coverage @SukkaW [#4014]
- ๐ style(test-helper-is): asyncArrow space @SukkaW [#4015]
- โ test: improve coverage @SukkaW [#4050]
- ๐ test(load-database): fix EPERM error in windows @curbengh [#4069]
- โ test: useful sinon.assert @segayuu [#4164]
- โ test: replace from rewire to sinon.stub() @segayuu [#4157]
- ๐จ refactor test @segayuu [#4115]
- simplify unit test