Reputation: 2314
I want to use a variable provided from my CMS to reference an include template like this:
extends layout
include layouts/#{data[0].fields.layout}.pug
This just looks for layouts/#{data[0].fields.layout}.pug
rather than what I wan, e.g. main.pug
. Is there a way to do this?
Upvotes: 0
Views: 109
Reputation: 3242
Unfortunately, this is not possible at the moment. Dynamic includes are currently not supported by Pug (see this SO answer and this Github issue).
Upvotes: 1