title |
---|
Hexo 5.1.0, hexo-renderer-marked 3.1.0, hexo-math 4.0.0 & hexo-util 2.4.0 released |
-
feat(highlight): parse 'caption' option to prismHighlight @curbengh #4476
caption
is now available in prismjs:
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
.
- Revert "perf: avoid running plugins in 'clean' command" #4386 @curbengh #4470
- This fixes error in
hexo clean
.
- This fixes error in
- 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
-
feat: postAsset to prepend post's relative path #159
- With this feature,
asset_img
tag plugin is no longer required. - Only applies to
post_asset_folder
- An example is "image.jpg" is located at "/2020/01/02/foo/image.jpg", which is a post asset of "/2020/01/02/foo/".
![](image.jpg)
becomes<img src="/2020/01/02/foo/image.jpg">
- To enable:
post_asset_folder: true marked: prependRoot: true postAsset: true
- With this feature,
-
feat: lazyload #156
- Load image only when it's coming into view. Explainer
loading="lazy"
will be injected to every image embed<img>
.- Only takes effect on supported browsers.
- To enable:
marked: lazyload: true
- chore(deps-dev): bump hexo from 4.2.1 to 5.0.0 #158
-
The syntax is changed to tag plugin syntax
{% %}
#130- Examples:
{% katex %} c = \pm\sqrt{a^2 + b^2} {% endkatex %}
{% mathjax %} \frac{1}{x^2-1} {% endmathjax %}
- The renderer option is highly customizable and it can be different across posts and even within a post, refer to the documentation for usage guide.
- If you prefer to use
$...$
syntax, we recommend hexo-filter-mathjax which is also developed a Hexo developer, @stevenjoezhang.
- Drop Travis CI #134
-
fix(highlight): use
<div>
when wrap is disabled @curbengh #229- when
wrap
is disabled:
highlight: wrap: false # defaults to true
- previously, caption is rendered as:
<pre> <figcaption>caption</figcaption> <code></code> </pre>
- it's now rendered as:
<pre> <div class="caption">caption</div> <code></code> </pre>
- when
-
feat(prism): caption @curbengh #227
- caption is rendered as:
<pre> <div class="caption">caption</div> <code></code> </pre>
-
feat(highlight): support 'tab' & 'mark' when wrap is disabled @curbengh #225
- Previously
tab
andmark
options were only availble whenwrap
is enabled, now they are also available even whenwrap
is disabled. - Example:
highlight: tab_replace: ' ' wrap: false
{% codeblock lang:js mark:2,5 %} const input = [ { name: 'lorem', item: 'ipsum' }, { name: 'per', item: 'doming' }, { name: 'dolor', item: 'lorem' }, { name: 'usu', item: 'pericula' } ] {% endcodeblock %}
- Previously
-
docs(spawn): link to upstream docs @curbengh #223
spawn()
is a nice wrapper aroundchild_process.spawn()
, so it supports similar options.
-
feat(cache): cache#dump & cache#size @SukkaW #209
// Output number of key-value pairs cache.size(); // 3 // Outputs everything in cache cache.dump(); /* { foo: 'bar', baz: 123, qux: 456 } */
-
Support string argument in
spawn()
@curbengh #220- Previously
spawn()
only supports array argument:
spawn('cat', ['test.txt']).then((content) => { console.log(content); });
- Now string argument is also valid:
spawn('cat', 'test.txt').then((content) => { console.log(content); });
- Previously
-
fix(highlight): support caption when wrap is disabled @curbengh #210
highlight: wrap: false
```js caption const hi = 'bob' ```
- Drop Node 13 from CI @curbengh #219
- refactor(encode/decode_url): replace decodeURI with native querystring.unescape @curbengh #214
- chore(deps-dev): bump mocha from 7.2.0 to 8.0.1 #211
- chore(deps-dev): bump eslint from 6.8.0 to 7.0.0 #207
- Remove
HashStream()
function @curbengh #198- Deprecated in #45, part of v1.0.0 release
- Replaced by
createSha1Hash()
- Drop support of Node 8 @SukkaW #191 #193
- Requires
autoDetect
to be enabled andlang
to be unset to use sublanguagehighlight()
@curbengh #192 #196
- Fix
CacheStream()
compatibility issue with Node 14 @curbengh #195
- docs(isExternalLink): add JSDoc @YoshinoriN #190
- chore(deps-dev): bump rewire from 4.0.1 to 5.0.0 #187