Closed dpehrson closed 12 years ago
Howdy.
You should be able to make this work ... but you'll need to know the complete URL for every deployed asset in advance if you'd like to use MHTML. Simply pass the absolute URL prefix as the --base-url
when calling jammit
to generate your assets.
That said, the wise thing to do is probably not to bother with MHTML, and just use datauri embedding for modern browsers.
Hey there,
Thanks for the quick reply!
The problem is that even if I know what the base-url is (say host0.cdn.com) I'll get a link tag with an href like:
http://host0.cdn.com/release-a1b2c3/stylesheet-mhtml.css
The hostname will come from my asset_host configuration (It'd be up to me to find a way to pass the appropriate hostname to Jammit.package!) The release-XXXXXX comes from my asset_path configuration.
The problem is, any assets embedded in that stylesheet would have the URL:
mhtml:http://host0.cdn.com/assets/stylesheet-mhtml.css?1329086338!1-information-24.png
Which won't work because jammit ignores my asset_path configuration so the URL is incorrect. This is what I think may be the bug/feature request.
Unfortunately while I'm fine abandoning IE6 at this point, I need to continue to support IE7 as it constitutes about 10% of our traffic (we're consumer focused with an older demographic on many of our sites.)
The "base url" needs to include /release-a1b2c3
at the time you build your assets. Once the files are written out, how could they possibly know the value of asset_host
inside of your booted Rails app?
If you can't know the complete path to your assets ahead of deploy time, then using MHTML is impossible -- no tool can help you.
I'm having a head slap moment I think. Thank you.
Howdy,
I'm not really sure how to classify this as I'm not yet sure whether it's a bug, a feature request, or simply me attempting to use jammit beyond the way it was designed, but here goes...
I run a website that
This results in Jammit asset includes as such:
The problem I have is that MHTML documents don't work because:
The first problem is something that I can likely find a way to work-around, even if it's hackish, but I'm not sure I can do anything about the second one without changing Jammit itself.
Is there any way I can make this work? If not is this something Jammit sees as "fixable? Or should I start looking at an alternate solution? (I hope not, I love Jammit!)
Thanks in advance, and I hope this isn't an inappropriate place for asking this.