Sander's Blurbs

Menu

Content type versus routing in Cuttlefish

Cuttlefish is my hackable web/blog framework. I’m doing most of the hacking and eventually you might blog.

Rubber ducking a bit. Working on the coupling of the controller name being linked to the content structure. For example /posts/x loads the post controller with the post model and content from content/post/x.md.

It felt intuitive but I’m not happy deriving a path literally from a class name. In Particular the post archive is an archive controller with a post model. Also feeds/post vs feeds/auctions or something.

Originally I went with contentpath being based on a controller name property. But because the model already specifies the fields available in the content that didn’t seem right

So doing some work around each model having a content path property but not 100% if that’s the right relation.

Feels like It’s doing two things. Routing and content types.

For instance if I want a /blog I’d probably create a blog controller with a post model with records loaded from content/blog.

Looks like the controller is registered to a path via the router and it dictates the content path after all.