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

Slate Docker image v2.11.0 does not seem to use SassC, very slow CSS render. #1517

Open
flojdek opened this issue Oct 11, 2021 · 5 comments
Open

Comments

@flojdek
Copy link

flojdek commented Oct 11, 2021

Bug Description
I'm running the vanilla v2.11.0 from the Docker repo and it's not using SassC to compile the css and it is extremely slow.

$ docker run --rm --name slate -p 4567:4567 -v $(pwd)/src:/srv/slate/source slatedocs/slate:v2.11.0 serve
== The Middleman is loading
== Sprockets will render css with ruby sass
consider using Sprockets 4.x to render with SassC

Screenshots

image

Is this by design or is this a bug?

@MasterOdin
Copy link
Member

While using sassc would be ideal, it is not API compatible with the sass gem and that migration does not seem to be simple (see #1368 for some details). I'm not a user knowledgable Ruby developer, so happy to accept a PR on this, but not something I would be implementing, especially in favor of furthering work on slate v3 where we move to a JS based solution.

@flojdek
Copy link
Author

flojdek commented Oct 11, 2021

Hey @MasterOdin thanks a lot for quick reply. Understood. Any idea how to speed up the css loads with the current version? Apart from obvious caching on the edge servers.

@MasterOdin
Copy link
Member

The intention is that you would only use serve for development purposes, and use build for production given that slate is intended to be a static site.

If you really needed to use serve for some reason, I'd recommend probably compiling down the sass stylesheets into css separately, and then link to those built css files in the erb template when you do serve, avoiding the sass compilation step (assuming you're not doing some level of dynamism there).

@flojdek
Copy link
Author

flojdek commented Oct 11, 2021

Sorry, what do you mean by build in PROD? Where is this documented? I only ever found examples with serve and I was specifically looking for some documentation how to properly run this thing in PROD in Docker. Can you point me to relevant documentation or just drop few lines here? That would be very much appreciated.

Yeah, I've actually tried that, but failed so far, seems the scss files always pop back in. Need to spend some more time on this one.

@MasterOdin
Copy link
Member

MasterOdin commented Oct 11, 2021

See https://github.com/slatedocs/slate/wiki/Using-Slate-in-Docker#building-slate for building Slate with Docker.

After running it, you will see the built artifacts in that build directory that was mounted into the container. I've updated the article to hopefully make that clearer.

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

No branches or pull requests

2 participants