我有一个包含数组的pug模板,我想将其传递给一个用于填充某些模式的mixin。org(json)标记。
代码如下:
轮廓帕格犬
include ../components/bio-seo
- var person = {}
- person.title = "Name, title of person"
- person.url = "https://page.url..."
- person.image = "https://images.url..."
- person.links = ["https://link.one...","https://link.two..."]
+bio-seo(person)
然后在mixin中,我有:
混音。帕格犬
mixin bio-seo(person)
title= title
link(rel='canonical', href=url)
script(type="application/ld+json").
{
"@context": "http://schema.org",
"@type": "Person",
"image": "#{person.image}",
"url": "#{person.url}",
"sameAs":
}
除了“sameAs”链接数组外,其他一切都很好。编译后,我得到:
"sameAs": https:
而不是我需要的
"sameAs": ["https://link.one","https://link.two"]