jade/pug 是否可以在 include 语句中使用变量?

jade/pug Is it possible to use variables on include statement?

我正在开发 nodejs 应用程序,我对 include 语句有疑问。 当我这样使用它时它起作用了:

include ../mixins/root.pug

...但是可以在 include 上使用变量吗?

None 这些作品:

include #{process.env.MIXINS_PATH}/root.pug
include !{process.env.MIXINS_PATH}/root.pug
include `${process.env.MIXINS_PATH}/root.pug`

结果是这样的:

Error: ENOENT: no such file or directory

不支持动态包含:

We don't support "Dynamic Include". There are lots of issues people have opened about this. It's really complex to implement and not actually nearly as useful as people think it would be.

https://github.com/pugjs/pug/issues/2622#issuecomment-270157667