Hacker News new | ask | show | jobs
by jordanlev 3770 days ago
How exactly does one specify / configure which content fields exist on a page? The problem I run into with most static site generators and flat-file CMS's is that even the ones claiming to "not be for blogging" still assume a very blog-like "one main content area per page"... which just doesn't fit the use-case of most sites I've built.

Didn't see anything in the docs about defining the content fields per page/template type, so figured I'd ask.

3 comments

Check out lektor (getlektor.com). It allows you to define your content fields in ini files- https://www.getlektor.com/docs/models/

I have been using it on a side project for the last week and I really like it!

It is correct that there is "one main content" per page, available in the 'body' attribute.

However, to me the distinctive feature of a blog is not that, but the way entries are ordered (i.e. reverse order by date). For a manual, faq, feature requests,... I need a different ordering scheme, but I am happy with the "one main content" concept.

That having said, there is of course a need combine content in a single page. A layout (aka template) can combine content as needed. It can use other attributes of the page, specified in the front matter. Or it can use the content from other pages. One could put subpages in a subdirectory, and use some filename convention so that a layout can access them.

Urubu has support for pages that are only present for content, and not for being rendered themselves: you can specify a 'null' layout in the front matter.

If that's what you're looking for, try https://getgrav.org/