ember-cli-addon-docs icon indicating copy to clipboard operation
ember-cli-addon-docs copied to clipboard

Version path segment is not added to compiled CSS URLs

Open kpfefferle opened this issue 7 years ago • 2 comments

It appears as though compiled CSS is not including the version path segment in ember-cli-addon-docs deployments that use versioned docs. See https://github.com/Addepar/ember-table/issues/593 for an example.

The ember-table demo there is referring to an SVG in CSS that is failing to load with a 404. This is because the file is deployed to the version directory at /ember-table/latest/@addepar/style-toolbox/assets/images/checkmark.svg while the CSS is pointing to /ember-table/@addepar/style-toolbox/assets/images/checkmark.svg. The compiled CSS is missing the /latest/ segment of the URL path.

kpfefferle avatar Dec 13 '18 21:12 kpfefferle

I took a look at this recently, and it appears that the fault lies in the style rule that we were using, which uses an absolute URL, resulting in this CSS:

background-image: url('/@addepar/style-toolbox/assets/images/checkmark.svg');

I think the docs for addon-docs could be improved by clarifying how asset compilation works when deploying, but it looks to me like the specific issue at hand here is that the underlying CSS rule is hardcoding an absolute path to the asset.

bantic avatar Jul 17 '19 14:07 bantic

@bantic Isn't it the job of the build process to find these URLs and update them? The build process is already adding the /ember-table segment to the above asset path (as noted in my prior comment), so wouldn't you think it should also be responsible for adding the /latest (or other version) segment to the URL path?

kpfefferle avatar Jul 17 '19 14:07 kpfefferle