What is considered best practice if I want to use compile Bootstrap from LESS files in my Apostrophe project?
Is it better to install Bootstrap via NPM, or should I manually download Bootstrap and place the files in lib/modules/apostrophe-assets/
?
I have reviewed the documentation that I am aware of to try and figure this out. I am not finding any documentation about including CSS and JS assets which are located outside of the lib
folder.
I'm the lead developer of Apostrophe at P'unk Avenue.
You can put those files in lib/modules/apostrophe-assets/public/css (and subdirectories thereof, if desired) and include the one that imports all of the others in your configuration for
apostrophe-assets
, exactly as described in the tutorials:Pushing assets to the browser
Or you can import it from a LESS file of your own that also imports your custom site-specific styles. That's really up to you.
Of course there is also nothing stopping you from adding assets directly to your
outerLayout.html
vialink
andscript
tags but if you want to take advantage of Apostrophe's minification process, follow the tutorial.To be clear, any and all templates in Apostrophe can be overridden for your particular project WITHOUT modifying the node_modules/apostrophe folder in any way.
If a template exists at this path:
Then just copy it here in your project:
And your version will be rendered instead.
You can use the Nunjucks
extends
keyword to extend templates that you invent yourself. You can also use cross-module syntax to extend templates that are in a different module:Hope this clears things up a little better!