PlaidWeb / Publ

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

Normalize generated links to the default template #541

Closed fluffy-critter closed 1 year ago

fluffy-critter commented 1 year ago

Summary

If a link is requested to the default template, don't put the template name into the link. Fixes #533

Detailed description

This adds an index_template property to Category objects, which indicates what the default index template for that category is. Links generated which request the default template will have that omitted.

This also updates path_alias to have the same index-template-respecting logic for category views.

Developer/user impact

Can now get rid of a bunch of crap like

view.link(template=template if template != 'index' else '')

or whatever.

Test plan

See the category-index tests.

Got a site to show off?