Hexo 4.1.1, hexo-util 1.7.0 & eslint-config-hexo 4.0.0 released

We have released a bugfix release for hexo, and new version of official hexo plugins hexo-util and eslint-config-hexo.

hexo 4.1.1

Feature

  • Add trailing_html: to pretty_urls: option to remove “.html” from url #3917

    • Use the following config to remove the trailing “.html” from permalink variables
    _config.yml
    pretty_urls:
    trailing_html: false
    • Example: https://example.com/page/about.html -> https://example.com/page/about

Fixes

  • Set default locales (in “language_TERRITORY” format) for og:locale Open Graph tag #3921
    • Previously og:locale was inserted only if language: is configured in “language-TERRITORY” format
    • With this fix, if the language is “en”, og:locale will default to “en_US”. Refer to the pull request for the full list.
  • meta_generator() helper should output the correct Hexo version #3925
  • permalink_defaults: option should be parsed, not replaced #3926
  • “node_modules/“ and “.git/“ folders in themes/ are now always ignored #3918

Refactor

  • Further reduces lodash usage #3880

hexo-util 1.7.0

Features

  • deepMerge() utility #141
    • Based on deepmerge library
    • target object is not modified, which is different to Object.assign() and lodash.merge
  • prettyUrls() utility #152
    • This is used to remove trailing .html or index.html from a url string
    • Typically used for SEO, particularly to create canonical url

Fixes

  • wrap: option is no longer disabled when hljs: is enabled in code highlight highlight() utility #138

    • Since wrap: is enabled by default, if you prefer previous behavior of hljs:, you need to specifically disable wrap:,
    _config.yml
    highlight:
    wrap: false
    hljs: true
  • url_for() & full_url_for() should ignore absolute url (i.e. links that start with “http” or double slash “//“) #147

  • Selecting a codeblock should not include line number #153

    • This reverts breaking change introduced in #132

eslint-config-hexo 4.0.0

Features

  • Support up to ES2020 syntax by using eslint-plugin-node v10 #23
  • Prefer ES6+ syntax #22
  • Remove deprecated/duplicated rules #4, #6, #21

Fix

  • Retain legacy URL API #19
    • Contrary to the pull request’s description, Node 8 actually does support the newer WHATWG URL API.
    • However, it is later found that migrating completely to the newer API caused performance regression, so for now hexo uses a mixture of legacy and newer API. hexojs/hexo#3833, hexojs/hexo#3846