CarterA / Tribo

Extremely fast static site generator written in Objective-C
http://cartera.me/2011/10/16/made-on-a-mac/
Other
42 stars 6 forks source link

Dynamic Template System #35

Open GeorgeWS opened 12 years ago

GeorgeWS commented 12 years ago

So, I just got Tribo up and running with my site, and I noticed that there wasn't an add button in the Templates tab, which was a problem because I wanted to add a Feed.mustache file to set up my RSS feed. @CarterA told me to just add it manually, because the templates are hardcoded and there are only ever going to be three of them. But if that's the case, then why are we putting them into a lovely list that looks like it should be filled with templates?

Okay. Here's my thought: we need a way of adding additional templates for different types of pages. For instance, we may want to have a slightly different template or type of page for the link-list style posts brought up in #27. But this should be a more general solution that also would allow for something like having a Project.mustache template, or, perhaps, running a blog where you have three different "types" of posts (say, recipes, tutorials, and articles) that each take on a slightly different format, and each adhere to a different mustache template.

This brings up the issue of how Tribo would know which files used which templates. One way to solve this could simply be having additional folders in the root directory of your project for each type of page. Currently, there's a Posts folder there. In the example above, you'd have an Articles folder, a Recipes folder, and a Tutorials folder there instead. But then, do we add a tab for each of those things in Tribo? What term can we use to collectively address all of them? "Pages" seems too generic. Just "posts"? Overall, there's still a lot to be thought through here, but I think we should definitely make templates a more dynamic thing.

CarterA commented 12 years ago

I don't know how to address all of these things yet, but I can say that "Pages" seems to be the exact right amount of generic. It's what we use in the model layer too.