I'm trying to add Font Awesome to a Bootstrap subtheme I have made.
Here is the code I am using in subtheme.libraries.yml
, which is based on the documentation for hosting external JS libraries in Drupal 8:
font-awesome:
remote: https://fortawesome.github.io/Font-Awesome/
version: 4.5.0
license:
name: MIT
url: https://fortawesome.github.io/Font-Awesome/license/
gpl-compatible: true
css:
https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css: { type: external, minified: true }
Unfortunately this results in a WSOD. The error log gives these two errors:
Warning: constant(): Couldn't find constant CSS_HTTPS://MAXCDN.BOOTSTRAPCDN.COM/FONT-AWESOME/4.5.0/CSS/FONT-AWESOME.MIN.CSS in Drupal\Core\Asset\LibraryDiscoveryParser->buildByExtension() (line 143 of /srv/bindings/code/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php).
And:
Warning: Illegal string offset 'weight' in Drupal\Core\Asset\LibraryDiscoveryParser->buildByExtension() (line 143 of /srv/bindings/928c941920f8443d9e50a3d908967fee/code/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php).