Multi包括JADE中的文件

时间:2016-03-11 07:37:20

标签: html pug

我现在在index.jade文件中有什么:

html
  include head
body
  include header
  include main
  include aside
  // a bunch of other includes
  include footer

我更喜欢接收

html
  include head.jade
body
  +multiinclude('header','main','aside','footer')

但是,当我试图将mixin中的参数传递给include指令时,它不起作用:

mixin multiinclude(...includes)
  each i in includes
    include= i

只需添加<include>header</include>代码

1 个答案:

答案 0 :(得分:0)

您正在将字符串传递给您multiinclude mixin。

您也尝试循环输入,但它们不是数组格式。

也许你应该包含一个body.jade文件,并在body.jade中包含身体的不同部分?