Skip to content

v0.4.2

Latest

Choose a tag to compare

@dillonzq dillonzq released this 28 Nov 12:22
· 4 commits to master since this release
v0.4.2
8d5cc7a

0.4.2 renders Mermaid diagrams with Pele, rebuilds search as a native dialog, processes images with Hugo, inlines the theme's icons, and adds Mastodon comments, code line wrapping, author avatars and llms.txt. Hugo 0.146.0 or later and Dart Sass are still required. See the CHANGELOG for the full list.

Before You Upgrade

  • Template overrides. The header and search markup, code blocks, icons (<svg class="icon …"> instead of <i>) and heading anchors changed. Sites that override _partials/header.html, _partials/search.html, _partials/plugin/code-block.html, _partials/plugin/icon.html or assets/js/theme.js should compare them with the new files. The theme script is now a JavaScript module built for ES2020, split into a core and a module per feature under assets/js/features/.
  • Mermaid diagrams render with Pele instead of Mermaid. Pele has its own layout and style, no HTML labels, and ignores click callbacks and Mermaid themes. Set renderer = "mermaid" under [params.page.mermaid] to keep Mermaid 12.3.0.
  • Security defaults. The referrer policy defaults to strict-origin-when-cross-origin instead of no-referrer, and Mermaid uses securityLevel strict. Set referrerPolicy or mermaidSecurityLevel under [params.security] to change them.
  • Images. lazysizes is removed: images no longer get the lazyload classes or data-src/data-srcset attributes, and use native lazy loading with width, height and a WebP srcset made by Hugo. The first cold build takes longer while Hugo makes the copies.
  • Font Awesome loads only on pages whose content uses it. Set params.page.fontawesomeCSS = true if your own layouts use Font Awesome classes.
  • Removed libraries. autocomplete.js, object-fit-images, the Polyfill service, clipboard.js and animate.css are gone. Code that calls ClipboardJS or adds animate__* classes must load those libraries itself.
  • Deprecated options. params.compatibility.polyfill, params.compatibility.objectFit and params.cdn.autocompleteJS have no effect, print a build warning, and are removed in 0.5.0. Builds with --panicOnWarning fail until you remove them.
  • Headings no longer get the headerLink class.

Highlights

  • Mermaid diagrams drawn with Pele: a script about 83% smaller, faster rendering, layouts that adapt to narrow screens and zoom buttons
  • Search in a native <dialog> with an ARIA combobox, a search field that grows in the header, and / and Ctrl+K / ⌘K shortcuts
  • Images processed by Hugo with width, height, a WebP srcset and native lazy loading
  • The theme's icons are inline SVG built at build time, and Font Awesome loads only where content uses it
  • Mastodon comments from the public replies to a Fediverse post
  • Line wrapping for code blocks, and buttons that toggle line numbers and wrapping
  • An author avatar in the post meta (thanks @kiannidev)
  • A link to each page's Markdown version and an optional llms.txt
  • A build warning, once per build, for deprecated options
  • Accessibility: higher contrast and underlined links in content, named heading anchors, Read More links and icons, 24×24 px targets, alt text from Markdown image descriptions, and highlighted footnote targets

What's Changed

  • fix(security): default to a strict-origin referrer policy and strict Mermaid by @dillonzq in #1106
  • feat(a11y): name Read More links, use https microdata and highlight footnote targets by @dillonzq in #1105
  • feat: warn once about deprecated configuration options by @dillonzq in #1107
  • fix(a11y): build heading anchors with an accessible name by @dillonzq in #1108
  • ci: fail ci-gate when the example site's metrics regress against master by @dillonzq in #1109
  • fix(a11y): raise light and dark theme contrast and underline links in content by @dillonzq in #1110
  • perf: render the theme's icons as inline SVG and load Font Awesome only where content uses it by @dillonzq in #1111
  • feat: process images with Hugo and load them with native lazy loading by @dillonzq in #1116
  • feat(search): replace autocomplete.js with a native dialog and ARIA combobox by @dillonzq in #1117
  • chore: remove legacy polyfills, clipboard.js and animate.css by @dillonzq in #1118
  • fix(a11y): use the Markdown image description as its alt text by @dillonzq in #1119
  • fix(a11y): make TOC links, share buttons and header links 24×24 CSS px targets by @dillonzq in #1121
  • feat(mermaid): render diagrams with Pele by default, keep Mermaid as an option by @dillonzq in #1122
  • feat(search): grow the search field in the header and drop results below it by @dillonzq in #1123
  • refactor(js): split theme.js into a core and feature modules by @dillonzq in #1124
  • feat(meta): show the author avatar in the post meta by @kiannidev in #1030
  • feat(comment): show the replies to a Mastodon post as comments by @dillonzq in #1125
  • chore: version the unreleased changes as 0.4.2 by @dillonzq in #1126
  • feat(seo): link the Markdown version and llms.txt of a page in the head by @dillonzq in #1127
  • ci(metrics): post Metrics results as a pull request comment by @dillonzq in #1128
  • feat(code): wrap long lines and toggle line numbers and wrapping by @dillonzq in #1129
  • chore: prepare for v0.4.2 by @dillonzq in #1130

Full Changelog: v0.4.1...v0.4.2