Closed kellysutton closed 12 years ago
Great idea. Will merge shortly.
Whoops, I might apply a patch to this. Right now, a CDN URL requires a slash at the end. I need to make it work regardless of the slash or not.
Also, it could check the root of _config.yml
, but I'm not sure how encapsulated you want to make this. (Falling back to the root of _config.yml
lets other plugins use the CDN URL as well. For example:
server_port:4000
cdn: https://my-cdn.cloudfront.net
vs.
server_port: 4000
asset_bundler:
cdn: https://my-cdn.cloudfront.net
You could edit the self.config
method to check the cdn
option like I do for the dev
option.
Also as far as a top-level option goes, I do the same thing with the dev
option, but I did poke around in the existing plugins to see if it was used.
I've merged this locally and added a check on the base_path
option to make sure that there's a preceding slash. This lets the cdn
url setting work no matter what.
I will close after I push to master. I'm currently ignoring the root cdn
option in _config.yml
. Not sure if it's necessary. Does anyone else use it?
Just a new little configuration parameter:
Will generate URLs that prepend the CDN URL.