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: 前置元數據中支援 ‘disableNunjucks’ @curbengh #4518

    ---
    title: foo
    date: 2020-01-02 03:04:05
    disableNunjucks: true|false
    ---
  • fix: 避免在不必要時轉義前置元數據 @curbengh #4522

    • 使用帶有特殊字元的變數(例如 {{ title }})不再會導致雙引號包裝
  • fix: 驗證 config.url 的值 @curbengh #4520

    • config.url 應以 “http://“ 或 “https://“ 開頭
  • fix(router): 在路由流中將字串轉換為緩衝區 @ppoffice #4517

    • 修復 hexo generate --bail 中的崩潰
  • fix(disableNunjucks): 查詢渲染器的非同步和同步版本 @curbengh #4498

  • 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: 將篩選器擴展到 tokenizer #165
  • feat: ‘quotes’ 選項可覆寫 smartypants #161
    • 現在可以指定要替換的引號符號。
    • 例如 quotes: '«»“”'

修復

  • fix: 處理無效的 URL #163
    • 無效的 URL(如 https://#:4000lorem)不再被編碼
  • fix: autolink 選項不應應用於 Markdown 語法 #162
    • autolink: 不再影響 <http://example.com>
    • 另一方面,如果連結沒有以協定開頭 (例如 http://),marked 渲染器不會偵測到 example.com,連結必須以 www 開頭才能被偵測到 (用於自動連結)。

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: 支援 globbing #37

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