Javascript 将容器div添加到Jade mixin
我试图在keystonejs的后期混合中添加一个名为.desc的h2&p标记。但每次我添加此项时,都会出现以下错误:Javascript 将容器div添加到Jade mixin,javascript,node.js,pug,keystonejs,Javascript,Node.js,Pug,Keystonejs,我试图在keystonejs的后期混合中添加一个名为.desc的h2&p标记。但每次我添加此项时,都会出现以下错误: Sorry, an error occurred loading the page (500) blog.jade:5 3| mixin post(post) 4| .post(data-ks-editable=editable(user, { list: 'Post', id: post.id })) >5| .desc 6| h2.entry-title=post.ti
Sorry, an error occurred loading the page (500)
blog.jade:5
3| mixin post(post)
4| .post(data-ks-editable=editable(user, { list: 'Post', id: post.id }))
>5| .desc
6| h2.entry-title=post.title
7| p.lead.text-muted.entry-utility Posted
8| if post.publishedDate
Invalid indentation, you can use tabs or spaces but not both
我正在尝试将.desc包装添加到内容:
mixin post(post)
.post(data-ks-editable=editable(user, { list: 'Post', id: post.id }))
.desc
h2.entry-title=post.title
p.lead.text-muted.entry-utility Posted
if post.publishedDate
| #{post._.publishedDate.format('MMMM Do, YYYY')}
if post.categories && post.categories.length
| in
each cat, i in post.categories
a(href='/category/' + cat.key)= cat.name
if post.image.exists
img(src=post._.image.fit(160,160)).img.pull-right
p!= post.content.brief
下面是mixin通常的样子:
mixin post(post)
.post(data-ks-editable=editable(user, { list: 'Post', id: post.id }))
h2.entry-title=post.title
p.lead.text-muted.entry-utility Posted
if post.publishedDate
| #{post._.publishedDate.format('MMMM Do, YYYY')}
if post.categories && post.categories.length
| in
each cat, i in post.categories
a(href='/category/' + cat.key)= cat.name
if post.image.exists
img(src=post._.image.fit(160,160)).img.pull-right
p!= post.content.brief
我使用的是phpstorm,间距仅设置为制表符。你的mixin主体(mixin post(post)下面的行)应该缩进一级。尝试过了,没有运气。谢谢你的回复。