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

[Enhancement] ember-cli-github-pages should fix asset paths loaded through css/js. #11

Open
DanielOchoa opened this issue Mar 30, 2015 · 6 comments

Comments

@DanielOchoa
Copy link
Contributor

Right now, when making a dist for gh-pages, assets loaded through css or js will not have the correct path, given that gh-pages expects asset paths to have the repo prefix. For example: ember-cli-github-pages/images/some-image.jpg.

@elwayman02
Copy link
Contributor

This seems like more of a bug than an enhancement, but either way it's definitely needed. Here's an example of a demo app where the assets load incorrectly due to this issue:

http://elwayman02.github.io/ember-bug-widget/

@elwayman02
Copy link
Contributor

rounders/ember-world-flags#3 details how to fix this issue manually. Essentially, you need to edit all vendor assets to use the app name twice in their paths, since the demoURL path includes the app name and the built app has a folder named after the app which contains the assets.

rounders added a commit to rounders/ember-world-flags that referenced this issue Sep 23, 2015
@knownasilya
Copy link
Contributor

Is this an issue if configured correctly, and are you sure you're not having issues with fingerprinting of dynamic assets?

@knownasilya
Copy link
Contributor

Ping

@elwayman02
Copy link
Contributor

@knownasilya I definitely had this issue on multiple addons and it wasn't a fingerprinting problem in the past. I am not sure if it still exists as I haven't had to deploy an addon with asset loading on the recent versions of this addon

@imfly
Copy link

imfly commented Apr 18, 2016

Hi, guys, I think this should be an enhancement, instead of a bug. If your images and fonts are not in the assets folder, you should use a absolute path like /images/some-image.jpg, not images/some-image.jpg in your *.css , *.less, or *.scss, and use relative path like images/some-image.jpg in the *.hbs.

It works well if you use a domain, org's or user's gh-pages, because all of these have no directory prefix /project-name .

Demo:

sources: https://github.com/Ebookchain/ebookchain.org (with fingerprinting of dynamic assets)

site(on gh-pages): http://ebookchain.org

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

5 participants