0

I am trying to import the third party plugins into a landing page in the system. The documentation here clearly states that the default path for the files should be lib/modules/apostrophe-assets/public/css/ and when I add the needed plugin css and js files in the folder and restart the server the are not picked up by the system. I also checked to see if the files were getting minimized and added to the one compress js/css file but they are not. The code in app.js file is

// Standard Apostrophe Modules
        'apostrophe-assets': {
            stylesheets: [
                {
                    name: 'bootstrap',
                    name: 'site',
                    name: 'font-awesome'

                }
            ],
            script : [
                {
                    name: 'bootstrap',
                    name: 'site',
                    name: 'jquery.matchHeight',
                    name: 'jquery.scrollTo'
                }
            ]
        },
Parik Tiwari
  • 1,525
  • 1
  • 12
  • 19

1 Answers1

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!

Tom Boutell
  • 7,281
  • 1
  • 26
  • 23