Publ: Development Blog

Publ v0.8.19 released

Posted (5 hours ago)

Wow, it’s been a while since I’ve posted a release announcement, huh.

A lot has changed since the last announcement. Here’s a short-ish version of what’s changed:

  • Update the minimum Python version to 3.10
  • Remove the old/broken publ.__version__ mechanism
  • Improve how entry plaintext output works
  • Fix how <br> works in HTML sanitization
  • Remove a bunch of deprecated stuff
  • Stop trying to infer a timezone, which was causing more problems than it helped with (see note)
  • Change the browser-side caching behavior to be more in line with modern standards
  • Simplify crawler bot detection and detect new bots more generally
  • Fix missing headers on certain error response pages (particularly Retry-After for 429 and 503), and generally clean up error handling
  • Remove a useless old dependency on awesome-slugify
  • Massively improve the publ normalize tool to make it actually useful (see note)
  • Provide correct Content-Type headers for alternate error pages (e.g. via Accept)
  • Improve the way that the Content-Type header is formed, and only force a utf-8 charset on text/* and if a charset isn’t already specified there

Stop inferring a timezone

Previously, Publ tried to be friendly about the timezone if it was unspecified, but that was causing some pretty major issues. Now all times (Date, Last-Modified, etc.) are in UTC unless otherwise specified.

The auto-indexer will use localtime to set the timezone on the generated date, but if you’re ever forming a date manually (e.g. for scheduled posts), now you must provide the correct timezone as well.

Improve the normalize tool

I used to have a bunch of ad-hoc Python scripts that tried to do all sorts of bespoke things on a per-site basis, because the existing normalize tool didn’t actually cover my needs. Which means it probably didn’t cover anyone else’s needs, either.

Now it’s actually useful; namely, you can have different formats based on an entry’s Entry-Type, it does a much better job of avoiding filename collisions.

There are a few known issues with it right now; in particular, it doesn’t handle attachments correctly, and I’m trying to figure out a decent way to codify excluding categories although for now it’s easy enough to just have a script that applies different normalization rules to different directories.

It’d also be a good idea to be able to specify multiple entry types on a single format string.

But hey, this vastly improves my own workflow, at least.

Big things I still need to take care of at some point