ember-cli-github-pages icon indicating copy to clipboard operation
ember-cli-github-pages copied to clipboard

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

Open DanielOchoa opened this issue 10 years ago • 6 comments

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.

DanielOchoa avatar Mar 30 '15 22:03 DanielOchoa

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 avatar Aug 31 '15 20:08 elwayman02

https://github.com/rounders/ember-world-flags/pull/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.

elwayman02 avatar Sep 22 '15 04:09 elwayman02

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

knownasilya avatar Feb 09 '16 20:02 knownasilya

Ping

knownasilya avatar Feb 23 '16 01:02 knownasilya

@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

elwayman02 avatar Feb 29 '16 18:02 elwayman02

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

imfly avatar Apr 18 '16 01:04 imfly