Releases: hexojs/hexo
Releases · hexojs/hexo
5.4.1
v6.0.0
Breaking Changes
- Drop Node 10 @stevenjoezhang [#4779, #4691]
Security
Please see more detail: Announcement: About CVE-2021-25987
New features
- feat: load hexo plugin in the theme's package.json @stevenjoezhang [#4771]
- feat(open_graph): different URLs for
og:image
andtwitter:image
@KentarouTakeda [#4748]
Performance
- perf(tag/helper): memoize @SukkaW [#4789]
- perf(external_link): optimize regex @SukkaW [#4790]
- refactor/perf: use nanocolors @SukkaW [#4788]
- Switch to picocolors @tomap [#4825]
- perf: avoid using delete operator @SukkaW [#4711]
- perf: overall improvements @SukkaW [#4783]
- refactor/perf(post): use state machine to escape swig tag @SukkaW [#4780]
- refactor: refactor pagination - paginatorHelper - pagenasionPartShow @CroMarmot [#4662]
Fixes
- fix(post): escape swig full tag with args @stevenjoezhang [#4824]
- fix(processor): remove race condition failsafe @SukkaW [#4791]
- fix(#4780): curly brackets @SukkaW [#4784]
- fix(#4780): empty tag name correction @SukkaW [#4786]
- Generate draft assets in draft mode @darekkay [#4563]
Refactor
Docs
- doc: add homebrew install @chenrui333 [#4724]
- doc(extend/console): add jsdoc @SukkaW [#4500]
Dependencies
- Cleanup dependabot @tomap [#4820]
- chore: bump actions/stale from 3 to 4 @dependabot [#4828]
- chore: bump sinon from 11.1.2 to 12.0.1 @dependabot [#4810]
- chore: bump eslint from 7.32.0 to 8.0.0 @dependabot [#4799]
- chore: bump hexo-log from 2.0.0 to 3.0.0 @dependabot [#4794]
- chore: bump husky from 4.3.8 to 7.0.2 @dependabot [#4763]
- chore: bump sinon from 10.0.1 to 11.1.2 @dependabot [#4747]
- chore: bump mocha from 8.4.0 to 9.1.1 @dependabot [#4765]
- chore: bump lint-staged from 10.5.4 to 11.0.0 @dependabot [#4697]
- Upgrade to GitHub-native Dependabot @dependabot-preview [#4689]
- chore(deps-dev): bump sinon from 9.2.4 to 10.0.0 @dependabot-preview [#4670]
- chore(deps-dev): bump hexo-renderer-marked from 3.3.0 to 4.0.0 @dependabot-preview [#4649]
New Contributors
- @CroMarmot made their first contribution in #4662
- @darekkay made their first contribution in #4563
- @dependabot made their first contribution in #4697
- @chenrui333 made their first contribution in #4724
Full Changelog: 5.4.0...6.0.0
v5.4.0
New features
Breaking change
- fix(excerpt): use span instead of anchor element for better SEO performance @stevenjoezhang [#4627]
Fixes
- fix(box): set property awaitWriteFinish for chokidar filewatcher @stevenjoezhang [#4633]
- fix(codeblock): match whitespace but not newlines @stevenjoezhang [#4625]
- fix(i18n): page.lang is undefined when using the key
language
in front-matter @stevenjoezhang [#4614]
Misc
- github: update actions/setup-node action to v2 @stevenjoezhang [#4604]
- chore/ci: migrate from probot/stale to GitHub Actions @stevenjoezhang [#4598]
Dependencies
- chore(deps): bump js-yaml from 3.14.1 to 4.0.0 @dependabot-preview [#4607]
v5.3.0
New features
- expose
escape_html
helper method for string manipulation to templates @awwong1 [#4581] - list_tags: span element & custom class for label @noraj [#4578]
Fixes
- fix(load_plugins): ignore plugin whose name is started with "hexo-theme" @stevenjoezhang [#4592]
- fix(codeblock): closing code fence may be followed only by spaces @stevenjoezhang [#4574]
Refactor
- Replace
process.mainModule
withrequire.main
@stevenjoezhang [#4583]
Docs
5.2.0
Changes
- perf(external_link): faster regexp @SukkaW [#4536]
- prioritise
http(s)://
over//
- prioritise
- feat: support 'disableNunjucks' in front-matter @curbengh [#4518]
- Enable this option to disable tag plugin
- Setting this option in front-matter will override the same option set by the renderer (e.g. hexo-renderer-marked)
--- title: foo date: 2020-01-02 03:04:05 disableNunjucks: true|false ---
- fix: avoid escaping front-matter if unnecessary @curbengh [#4522]
- using variable (e.g.
{{ title }}
) with special characters no longer result in double-quote wrap
- using variable (e.g.
- fix: validate value of config.url @curbengh [#4520]
config.url
should starts with "http://" or "https://"
- fix(router): convert string to buffer in route stream @ppoffice [#4517]
- fix crash in
hexo generate --bail
- fix crash in
- fix(disableNunjucks): query both async and sync versions of renderer @curbengh [#4498]
disableNunjucks
option should now works reliably with synchronous renderer
- feat(load_plugin): ignore pkg name endswith theme name @SukkaW [#4497]
- An initial effort to support scoped package
Housekeeping
5.1.1
Changes
- fix(filter/highlight): avoid escaping curly bracket when highlight & prismjs disabled @curbengh [#4489]
- When both highlight.js and prismjs are disabled:
# _config.yml highlight: enable: false prismjs enable: false
- there was an issue that curly brackets
{ }
are escaped{ }
mistakenly in the backtick_code_block.js filter. The fix is to avoid running that filter when code highlight is disabled. - Some users disable Hexo's default code highlight as they prefer to their own method.
5.1.0
Features
-
feat(highlight): parse 'caption' option to prismHighlight @curbengh [#4476]
caption
is now available in prismjs:
# _config.yml highlight: enable: false prismjs: enable: true
- It can be used in triple backtick codeblock:
``` js caption console.log('foo') ```
- above codeblock will be rendered as:
(class attributes are omitted for brevity)
<pre><div class="caption"><span>caption</span></div><code>console...</code></pre>
- you can style the caption by:
pre div.caption { font-size: 0.9em; color: #888; } pre div.caption a { float: right; }
- also available via
codeblock
andinclude_code
tag plugins.
-
fix: refactor post escape @SukkaW [#4472]
- fixed issue with prismjs that, in some cases, did not remove hexo's processing tag properly
-
Remove plugins option in config @stevenjoezhang [#4475]
# _config.yml plugins:
plugins
option has been deprecated long ago and it's now completely dropped- plugins should be saved in
scripts/
folder or installed via npmpackage.json
.
Performance
5.0.2
5.0.1
Changes
- fix(helpers): call url_for from hexo-util @curbengh [#4447]
- perf(external_link): update regexp @SukkaW [#4467]
- regex of
external_link
filter now pre-match external links, instead of solely rely onisExternalLink
- regex of
- perf(injector): shorthand optimization @SukkaW [#4462]
5.0.0
Breaking change
-
refactor(external_link): migrate config during load_config @SukkaW [#4414] [#4371]
- See Writing section for new options (introduced back in v4)
# _config.yml external_link: true|false # deprecated # New option external_link: enable: true|false
# _config.yml # https://hexo.io/docs/configuration#Date-Time-format use_date_for_updated: true # deprecated # New option updated_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)) { %>
-
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.
- This can be useful for a theme that prefers to display
-
feat(open_graph): drop 'keywords' option from front-matter @curbengh [#4174]
- Search engines no longer support
keywords
.
- Search engines no longer support
-
fix(#3464): override permalink use the front-matter @SukkaW [#4359]
- User config:
# _config.yml permalink: :year/:month/:day/:title/
- Front-matter
--- title: foo bar permalink: 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 # or permalink: :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
API
- Lodash
-
chore/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.
- Previously
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: load_plugin with extra line EOF @SukkaW [#4256]
- fix: parsing code error in backticks @seaoak [#4229]
- 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 op...