Publ: Development Blog

Publ v0.7.26 released

Posted (a year ago)

Here’s some new bugfixes and features!

  • OpenGraph tags now validate per the W3C validator
  • Images can now take a value of link=True in order to force a link to the full-size rendition without setting a lightbox gallery ID
  • Links will no longer include the template name if it’s the same as the category default (so you no longer need to do annoying things like view.link(template=template if template.name != 'index')
  • Similarly, path-alias to the index template will now work correctly if the category’s default template is not index

At some point in the not-too-distant future, two major overhauls are going to need to happen to Publ:

  1. Moving away from Pony ORM to something that works with Python 3.11 (possibly SQL Alchemy or even moving to lower-level indexing)

    I really like Pony ORM, but unfortunately some of the functionality I rely on only works with Python 3.10 and earlier, and a fix doesn’t seem likely to happen any time soon. (I’d love to be proven wrong, of course!)

  2. Finally replacing the Markdown processor with something that’s actively-maintained

    Misaka has been in archive mode for quite some time now, as its underlying Markdown implementation (hoedown) is abandoned. It works but it’s unclear how long it’ll stay working, and I’d rather stay ahead of the game.

    Plus, Misaka complicates the build environment for Publ anyway, since on platforms without a native build in pypi, it has to fetch the sources and compile by itself, and this isn’t very friendly to a lot of deployment environments. Having a pure-Python implementaton would make things a lot nicer.

    A more modern Markdown implementation would also enable a bunch of stuff that doesn’t work quite right as-is, like having inline <aside> and <details> within an entry. It’d also be a good excuse to finally add a few features I’ve been wanting to do, such as support for inline/sidebar footnotes and opengraph media embeds.

    This would require a complete rewrite of the Markdown processing within Publ, although those changes would at least be fairly self-contained. Unfortunately, a lot of the existing Markdown-handling code is extremely specific to Misaka’s quirks, so this might be something that takes a lot of iteration to get right. In particular, I worry that some of the Publ syntax extensions (particularly image rendition arguments, code block labeling, and multiple-image sets) might be difficult to support in a different engine with different parsing rules.

Also, some recent conversations have led me to realize that Publ’s documentation could be a lot better. If you’re interested in helping out, see publ-site issue #33.