Closed SteveMcArthur closed 4 years ago
The upcoming v2.0.0-refactor will support this, as well as the option to download and store the asset locally.
Implemented for v2.0.0-beta.1.
Just to note: The plugin will only treat assets added to Grav's Asset Manager (ie., addJs()
, addCss()
, etc), as accounting for other varieties would leave too many edge-cases. Assets added manually with a script
-element or indirectly via a CSS-file are thus ignored.
From v2.0.0 the --offline
parameter will ignore remote assets entirely, but otherwise download and store them.
I have some external assets in my project such as:
I think there needs to be a bit of code to check for "http" at the beginning of the string in the filename.
I've handled it at the moment by editing the Assets.php module and modifying that catch clause:
Basically if the string begins with "http" do nothing and just continue iterating.
I also think that an exception should not be thrown if a file doesn't exist - just a message to the console window. It's just a bit of a pain if the whole generation process fails just because of a missing js or css file.