Open isaacs opened 12 years ago
Have you thought about using DocPad? It already supports layouts, pre-processors, partials, includes as well as things like plugins, meta-data, static site generation, etc.
Templar is designed to support the needs of isaacs/npm-www . The design philosophy of that site is sort of the opposite of everything DocPad is.
Thanks for that and no worries! It has left me somewhat confused however :( as it seems the design philosophy's stance on "no framework - instead lots of small simple modules" is more or less building a framework in on itself - just one of interchangeable parts that aren't guaranteed to play nice together. Arguably DocPad provides the same goal of interchangeable parts but due to a consistent plugin API that helps to ensure they all play nice together.
The other design philosophies appear to align completely with DocPad, fast, in-memory, stylus support, compatible with search engines - with the other design philosophies being more centered around application development rather than template rendering and writing, so not applicable in this case.
The biggest difference I can see is that DocPad is primarily used with a bottom-up development style - templates come first, then server logic - whereas templar goes the top-down style - server logic comes first, then templates. However DocPad can also be used top-down in more or less the same way as templar via its API, so that kind of evens that difference out... in fact, it would be rather easy to plug the exact templar API directly on top of DocPad.
Give all this, it seems from my perspective that with enough feature requests (for instance this one about in-template layout support) templar could eventually fall into the same boat as DocPad (at least feature-set wise). So I'm real curious to hear your contrast between the two, as I'm failing to spot the differences on this one.
Also sincerely thanks for the opinion btw, really appreciate it. :)
Right now, I'm doing this everywhere:
and that's stupid.
It'd be better if I could just define the wrapper in one place, and then pass it in a 'main' local with the "real" template name. Like this