Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jammit not relativizing URLs as expected #28

Open
reefdog opened this issue Oct 29, 2015 · 1 comment
Open

Jammit not relativizing URLs as expected #28

reefdog opened this issue Oct 29, 2015 · 1 comment

Comments

@reefdog
Copy link
Contributor

reefdog commented Oct 29, 2015

I'm genuinely uncertain how Jammit is supposed to be acting right now.

My CSS contains local references like url('../font/fontello.eot?95329667') which, when compiled, are converted to reference my local filesystem structure with a weirdly part-relative / part-absolute syntax, e.g. url(../Users/justin/Projects/documentcloud-pages/src/css/vendor/fontello/font/fontello.eot?1433297684).

I would expect it to either:

  1. Keep the existing path
  2. Restructure the path to maintain relative traversal to the original resource
  3. Replace it with an absolute reference to the original resource
  4. Or something?

I'm genuinely unsure of correct behavior, as this Jammit issue acknowledges the problem and points to public_root as the answer, but I was unable to make public_root work. My guess is that the out-of-Rails use case isn't well tended.

Trying to resolve that led to fa09665 as a prerequisite.

reefdog added a commit that referenced this issue Oct 30, 2015
The impact of #28 has been hidden since I was already inlining the logo and font files. Kicking out the crutches to force me to figure out the fix.

* Use non-embedded Fontello (will let Jammit data-uri them)
* Use non-embedded logo images (will let Jammit data-uri them)
* Give logo files explicit names
@reefdog reefdog changed the title Jammit not relativizing URLs as expecting Jammit not relativizing URLs as expected Oct 30, 2015
reefdog added a commit that referenced this issue Nov 2, 2015
Simply can't get it working correctly with relative paths outside of Rails.

* Inline datauri-able assets
* Disable relative path rewriting
* Shuffle contents of `fontello` directory (and update references) so that `fontello/fonts` can be cleanly dropped into `dist` over on the DC side
* Remove `-datauri`-suffixed CSS files, as they're all datauri now

Basically giving up on #28
@reefdog
Copy link
Contributor Author

reefdog commented Nov 5, 2015

Partially worked around this by manually datauri'ing assets and not worrying about pre-datauri browsers (IE7).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant