Ltr stylesheets are missing

When I view the source on a Discourse forum that is not being served by a CDN, the stylesheet link tag points to a /stylesheets/ directory. Where is that directory?

1 Like

look this :
https://github.com/discourse/discourse/search?utf8=✓&q=stylesheets

globs = ["#{Rails.root}/app/assets/stylesheets/**/*.*css"]
1 Like

I don’t think that’t it for the production stylesheets.

1 Like

its in tmp directory and stylesheet_cache table

I’m asking because it’s not finding the _rtl stylesheet, but the RTL stylsheet is in tmp/stylesheet-cache/

1 Like

what version are you running, had some bugs I fixed yesterday.

upgrade to latest and be sure that assets:precompile runs.

The latest version on the master branch. assets:precompile runs. The ltr and rtl versions of the stylesheets are all present in tmp/stylesheet-cache.

With a LTR language the stylesheet link tag is outputting this:
<link href="/stylesheets/desktop_0eb6bcb9ae52a6f7bcd2c532c6f8f020d1b7a01b.css?__ws=forum.bookswithwings.org" media="all" rel="stylesheet">

This is finding the stylesheet.

With a RTL language the stylsheet link is:
<link href="/stylesheets/desktop_rtl_0eb6bcb9ae52a6f7bcd2c532c6f8f020d1b7a01b.css?__ws=forum.bookswithwings.org" media="all" rel="stylesheet">

This is returning a status of 404. But the rtl file is present in tmp/stylesheet-cache

I also tried setting up a new installation of Discourse and got the same results.

When I apply the changes made in this PR to an older version of Discourse (when you were still accessing the stylesheets in the uploads/stylesheet-cache directory, everything works as expected.

1 Like

confirmed, repro here, will get it sorted

1 Like

I bet it’s the underscore based splitting in the controller

1 Like

I tried removing the underscore before ‘rtl’ and it still couldn’t find the rtl stylesheets, but I might have missed something when I did it.

Yeah, this seems to fix the problem.

target,digest = params[:name].split("_")

target = params[:name].rpartition("_").first
digest = params[:name].rpartition("_").last
3 Likes

Pushed a fix

https://github.com/discourse/discourse/commit/bcaed90744bf470504b883010f28c9f59bd33505

4 Likes