jandecaluwe / urubu

A micro CMS for static websites, with a focus on good navigation practices.
urubu.jandecaluwe.com
GNU Affero General Public License v3.0
180 stars 36 forks source link

Allow setting `layout` in `index.md` #9

Closed brutus closed 9 years ago

brutus commented 10 years ago

Generally all pages under a folder (with it's own index.md) use the same layout - given a few exceptions. It would be nice if we could set a (default) layout in those index.md file(s), instead of needing to set it in every pagex.md (but pagex.md should be able to overwrite this default).

jandecaluwe commented 10 years ago

I don't agree for a number of reasons.

The same request for jekyll was held off for a long time. Now they seem to have added this, but with the expected complications of scoping rules, default handling and syntax. I don't like it.

Usually I do use various layouts, for example to switch between column widths for content (e.g. to render pages with source code better.), or to switch between a page with or without a sidebar. Also, I sometimes use a subfolder for content, with a dedicated layout of its index file. With template inheritance, we can easily generate useful variations, and there is nothing against using that feature to have a wide range of useful layouts.

Moreover, it is the layout attribute that triggers python validator functions, if any, enabling fine-grained control.

Changing the default layout for more sophisticated sites would therefore require to go into several pages to add the correct layout anyway. This means you probably wouldn't want to do that, so the feature would not add flexibility.

The current implementation, with the layout as almost the only mandatory attribute, is simple and transparant, and I would prefer to keep it like that.