Soupault 2.6.0 release
Soupault 2.6.0, is available for download from my own server and from GitHub releases. It's a relatively small release with a few bug fixes and one new feature: configurable index entry sorting method.
- Removed a dependency on the stringext library that is no longer necessary.
Fixed empty page output in a situation when the config has
generator_mode = falseand
keep_doctype = false, and the page lacks an
- Malformed dates no longer cause soupault to crash (that could happen due to incomplete exception handling).
Configurable entry sorting
Originally, soupault assumed that the index entry sort key field is some kind of a date. You could configure supported date formats using the
index_date_formats option, and it would attempt to parse every value as a date, or resorted to lexicographic comparison if parsing failed.
A lot of websites with auto-generated index pages are blogs, so that assumption wasn’t terribly unreasonable. However, it still was a rather inflexible design.
Now there’s a new option:
sort_type that can have three values:
calendar (the default),
calendar mode matches the old behaviour: it tries to parse a field value as a date according to supported
index_date_formats. Invalid values are considered “older” than any valid values. Between themselves, invalid values are compared lexicographically.
numeric mode, soupault will try to parse values as integer numbers. Invalid values are considered “less” than any valid values. This is useful in cases when you want to order pages or sections by “weight”.
lexicographic mode, soupault will simply compare values as strings.
There’s also a new
strict_sort option. If it’s set to
true, then soupault will log an error and terminate if it finds a value that cannot be parsed.
[index] sort_type = "numeric" strict_sort = true