我正在尝试将第三方插件导入系统中的目标网页。文档here 清楚地说明文件的默认路径应该是lib / modules / apostrophe-assets / public / css /,当我在文件夹中添加所需的插件css和js文件并重新启动服务器时,系统不会选择它们。我还检查了文件是否被最小化并添加到一个压缩js / css文件,但它们不是。 app.js文件中的代码是
// Standard Apostrophe Modules
'apostrophe-assets': {
stylesheets: [
{
name: 'bootstrap',
name: 'site',
name: 'font-awesome'
}
],
script : [
{
name: 'bootstrap',
name: 'site',
name: 'jquery.matchHeight',
name: 'jquery.scrollTo'
}
]
},
答案 0 :(得分:1)
I'm the lead developer of Apostrophe at P'unk Avenue.
What's wanted here is an array of objects, each of which has a name property.
What you have created is an array with just one object, which repeats its name property many times... which gives you only one object, with the last "name" property that you set. It's a JavaScript syntax issue really, not an Apostrophe issue.
Here is a correctly formatted array of objects:
'apostrophe-assets': {
stylesheets: [
{
name: 'bootstrap'
},
{
name: 'site'
},
{
name: 'font-awesome'
}
],
script : [
{
name: 'bootstrap'
},
{
name: 'site'
},
{
name: 'jquery.matchHeight'
},
{
name: 'jquery.scrollTo'
}
]
}
However, be aware that FontAwesome 4 is standard in Apostrophe — it is always present in the frontend build. You can push it again if you want to, especially if it's a different version and you configure a different prefix for it, but you probably don't need to do that.
Hope this is helpful!