Troglodyne-Internet-Widgets / tCMS

A Perl CMS with a focus on multiple media types, and flexible data storage backends
Other
2 stars 6 forks source link

Firm up Trog::Routes behavior #272

Open teodesian opened 1 year ago

teodesian commented 1 year ago

Currently there's no systematic mapping of route handlers. What we ideally should have is something that routes MIMEtypes provided in the Accept: header to the appropriate rendering module for a given route. If none is supplied, the route itself should define a default.

This also needs to be themable -- e.g. you can subclass in the themes/ directory for use in your custom routes & route overrides.

This will require the routes themselves to be re-factored to be renderer-agnostic, and the templating system to accomodate this. This is a JUMBO size t-shirt amigo

troglodyne commented 1 year ago

have some small amount of work already done on this pushed to gogs copy, intend to keep working on this as I get time

teodesian commented 1 year ago

One nice thing about this idea is that when all the routes are like this we can do things like autogenerate a swagger.json to describe the API of tCMS... and autogenerate a tCMS client for things like APIs.

teodesian commented 11 months ago

So I've done half the work here by making the renderers and theming content-type aware.

What's next is getting the route handlers themselves to do the right thing too.