PlaidWeb / Publ

Flexible publishing system for the web
http://publ.beesbuzz.biz/
MIT License
40 stars 4 forks source link

Category resolver fails for empty category #545

Closed fluffy-critter closed 10 months ago

fluffy-critter commented 10 months ago

Expected Behavior

mkdir -p emptycat/subcat
touch emptycat/subcat/entry.md

URL /emptycat should redirect to /emptycat/ (with no entries to display)

Current Behavior

URL /emptycat is a 404 error; /emptycat/subcat redirects correctly.

Possible Solution

In rendering.render_category_path, when checking to see if it's a malformed category URL (rather than a template URL), also check for extant subcategories, rather than for entries just in the current category.

Steps to Reproduce (for bugs)

1. 2. 3. 4.

Context

Reported by @SoniEx2 on Mastodon. Simple workaround is to create a non-displaying entry in the empty category (e.g. echo 'Status: GONE' > emptycat/foo.md) but it'd be better to just, like, fix it.