Hexo 5.2.0、hexo-migrator-wordpress 2.1.2、hexo-renderer-marked 3.2.0、hexo-renderer-stylus 2.0.1 和 hexo-renderer-less 2.0.2 发布

Hexo 5.2.0

变更

  • perf(external_link): 更快的正则表达式 @SukkaW #4536

    • 优先使用 http(s):// 而不是 //
  • feat: 在 front-matter 中支持 ‘disableNunjucks’ @curbengh #4518

    ---
    title: foo
    date: 2020-01-02 03:04:05
    disableNunjucks: true|false
    ---
  • fix: 避免不必要地转义 front-matter @curbengh #4522

    • 使用带有特殊字符的变量(例如 {{ title }})不再导致双引号包裹
  • fix: 验证 config.url 的值 @curbengh #4520

    • config.url 应以“http://”或“https://”开头
  • fix(router): 在路由流中将字符串转换为缓冲区 @ppoffice #4517

    • 修复 hexo generate --bail 中的崩溃
  • fix(disableNunjucks): 查询渲染器的异步和同步版本 @curbengh #4498

    • disableNunjucks 选项现在应该可以可靠地与同步渲染器一起使用
  • feat(load_plugin): 忽略以主题名称结尾的包名 @SukkaW #4497

    • 初步支持作用域包

维护

  • chore/ci: 将基准测试和性能分析移至 Actions @SukkaW #4525 #4514 #4335
    • Travis 现在完全被 Actions(在此仓库中)取代
  • chore: 使用 example.com 作为示例域名 @YoshinoriN #4512

hexo-migrator-wordpress 2.1.2

修复

  • fix(import-image): 正则表达式和图像 slug #103
    • 替换文章中嵌入图像的链接现在也应在包含一对括号“()”的段落中起作用。
  • fix(parseFeed): 净化输入 #106
    • xml 解析器 camaro 如果输入中存在不可打印字符,可能会抛出错误。这些不安全字符现在在被 camaro 解析之前被移除。

hexo-migrator-wordpress 2.1.1

修复

  • fix: 避免处理非文章资产 #99
    • 文章可能嵌入外部图像,它们不应由 import-image 处理。

hexo-renderer-marked 3.2.0

功能

  • feat: mangle 选项 #164
    • marked 的内置 选项
    • 仅对垃圾邮件机器人使用的基本爬虫有效。
  • feat: disableNunjucks 选项 #166
    • 启用此选项可禁用 Nunjucks 标签 {{ }} {% %} 的处理,特别适用于您不打算使用 标签插件 的情况。
  • feat: 将过滤器扩展到标记器 #165
  • feat: ‘quotes’ 选项以覆盖 smartypants #161
    • 现在可以指定要替换的引号符号。
    • 例如 quotes: '«»“”'

修复

  • fix: 处理无效 URL #163
    • 无效 URL(如 http://localhost:4000lorem)不再 编码
  • fix: autolink 选项不应应用于 Markdown 语法 #162
    • autolink: 不再影响 <http://example.com>
    • 另一方面,marked 渲染器不会检测 example.com,如果链接不以协议开头(例如 http://),链接必须以 www 开头才能被检测到(用于 autolink)。

hexo-renderer-stylus 2.0.1

修复

  • fix: 启用 disableNunjucks 以避免渲染 Nunjucks 标签 #55

    • 现在可以安全地使用
    div::before
    content: "{{}}"

hexo-renderer-stylus 2.0.0

重大变更

功能

  • feat: 使用 Stylus 上下文执行 Hexo 过滤器 #45

    hexo.extend.filter.register('stylus:renderer', function(style) {
    style
    // we may define a global variable by passing a `Node`
    .define('has-canvas', require('stylus').nodes.false);
    // stylus also casts JavaScript values to their Stylus equivalents when possible
    .define('families', ['Helvetica Neue', 'Helvetica', 'sans-serif'])
    // also allows you to provide a JavaScript-defined function to Stylus
    .define('get-list', function() {
    return ['foo', 'bar', 'baz'];
    });
    })

其他

  • docs: 设置变量 #41
    • 此功能从 0.3.1 开始就已可用,但直到现在才被记录。
    • 请参考 我们的指南

hexo-renderer-less 2.0.2

修复

  • fix: 启用 disableNunjucks 以避免渲染 Nunjucks 标签 #52

    • 现在可以安全地使用
    div::before {
    content: "{{}}";
    }

hexo-renderer-less 2.0.0

重大变更

  • 放弃 Node 8 #48 #44
  • compress 选项已弃用 #30
    • 被上游弃用。

功能

  • feat: 支持 Less.js 选项 #47

    • 支持 Less.js 选项
    • 示例
    _config.yml
    less:
    options:
    globalVars:
    var1: 'some value'
  • feat: 支持通配符 #37

    • 示例
    _config.yml
    less:
    paths:
    - '**/css/variables/*'