Skip to content

v0.6

Latest

Choose a tag to compare

@leafo leafo released this 21 Oct 23:55
v0.6

Breaking: syntaxhighlight is now the default highlighter

Fenced code blocks in markdown are now highlighted with the syntaxhighlight Lua library instead of Pygments. Nothing outside of Lua needs to be installed anymore, but the generated HTML is different:

  • Token class names are now prefixed with sh_, so existing stylesheets written for Pygments output need to be updated.
  • custom_highlighters registered on PygmentsPlugin must be moved to SyntaxhighlightPlugin. Sitegen prints a warning when it finds custom highlighters registered on a plugin that isn't loaded.

To keep using Pygments, swap the plugins in your site.moon:

sitegen.create =>
  remove_plugin "sitegen.plugins.syntaxhighlight"
  add_plugin "sitegen.plugins.pygments"

See the Migrating from Pygments docs for details.

Breaking: Analytics plugin uses Google Analytics 4

The analytics template helper now emits the gtag.js snippet instead of the retired ga.js one. Pass a GA4 measurement ID instead of a UA- account code:

$analytics{[[G-XXXXXXXXXX]]}

New

  • add_plugin and remove_plugin are available in site.moon for changing the default plugin set. Removing a plugin also unregisters any events it was listening to.
  • The syntaxhighlight plugin now supports custom_highlighters, matching the Pygments plugin.
  • Added js and scss language aliases to the syntaxhighlight plugin.
  • New HighlightPlugin base class (sitegen.highlight_plugin) shared by both highlighters, for writing your own highlighter plugin.
  • Plugin instances have a detach method, and events:off accepts an optional callback to remove a single handler.

Dependencies

  • Requires syntaxhighlight >= 1.1.0.

Full Changelog: v0.5...v0.6