I've started to digging into the Docpad for my current project and so far I've discovered 3 ways to include content.
- We use content template data variable to include child layout/document into the layout.
- We have include(relativePath) method to include the content of another file at the given path.
- Finally we have partials plugin which provides the way to insert documents into other documents, and also be passed by the docpad rendering engine.
We can use content variable only once per document. But often we have multiple places within static template where we need to include content. So why we ever need to use content variable if we always can use, say, include, or partials (when installed) which does not have this limit of only single usage per document? I guess that there are own pros, cons and use cases for each way of including content. So I'm wondering which way is most appropriate and in what case, assuming that we want to include content multiple times in one layout?