如何在停泊中包含的文件中使用块?
我想做类似本
//- page-a.pug
extends layout.pug
block scripts
script(src='/jquery.js')
script(src='/pets.js')
block content
include ./layout2.pug
block article1
something something....
block article2
something something....
pract1和present2的事情在layout2.pug文件中
I want to do something like this
//- page-a.pug
extends layout.pug
block scripts
script(src='/jquery.js')
script(src='/pets.js')
block content
include ./layout2.pug
block article1
something something....
block article2
something something....
article1 and article2 are in the layout2.pug file
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
目前,不允许使用多个哈巴狗中的多个块,请参阅 esjuction 。
但是,使用
Mixin Block
我们可以模拟多个块。例如:
index.pug
acrats.pug
生成的html:
Currently, multiple blocks in Pug are not allowed, see the issue.
But, using the
mixin block
we can simulate multiple blocks.For example:
index.pug
article.pug
Generated HTML: