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

Themes assets not found on production #348

Closed
fedemoretti opened this issue Feb 26, 2016 · 4 comments
Closed

Themes assets not found on production #348

fedemoretti opened this issue Feb 26, 2016 · 4 comments

Comments

@fedemoretti
Copy link

Hello, I deployed an application to a production server and did assets precompilation using bundle exec rake assets:precompile.
However, some assets inside my custom theme are not served (fonts, images, etc).

Do I need to include them in initializers/assets.rb ?

@owen2345
Copy link
Owner

Hi @fedemoretti
which server are you using?
because Camaleon come already configured to precompile all assets.
And is there any error precompiling?

@fedemoretti
Copy link
Author

Hi @owen2345, thanks for your quick response. I did some research and I found the problem was we were using more than one SCSS file and only application.css.scss gets precompiled.
We changed it to require the other files inside application.css.scss and everything is working now.
Thanks! I'm closing the issue.

@fedemoretti
Copy link
Author

Hi @owen2345, I thought the problem was solved but it was not. The problem is SASS assets helper methods are not working inside my scss files. I have a font-face setup as:

@font-face {
  font-family: 'Lato';

  src: asset-theme-url('fonts/Lato-Bold.eot'); /* IE9 Compat Modes */
  src: asset-theme-url('fonts/Lato-Bold.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
    asset-theme-url('fonts/Lato-Bold.woff2') format('woff2'), /* Modern Browsers */
    asset-theme-url('fonts/Lato-Bold.woff') format('woff'), /* Modern Browsers */
    asset-theme-url('fonts/Lato-Bold.ttf') format('truetype');
  font-style: normal;
  font-weight: 700;
  text-rendering: optimizeLegibility;
}

And my compiled CSS results in:

/* Webfont: Lato-Bold */
@font-face {
  font-family: 'Lato';
  src: asset-theme-url("fonts/Lato-Bold.eot");
  /* IE9 Compat Modes */
  src: asset-theme-url("fonts/Lato-Bold.eot?#iefix") format("embedded-opentype"), asset-theme-url("fonts/Lato-Bold.woff2") format("woff2"), asset-theme-url("fonts/Lato-Bold.woff") format("woff"), asset-theme-url("fonts/Lato-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  text-rendering: optimizeLegibility;
}

My fonts are in apps/themes/my_theme/assets/fonts
I have tried other helper methods like: asset_theme_path and asset_theme_url but none of them seem to work.

Any ideas?

@fedemoretti fedemoretti reopened this Mar 1, 2016
@owen2345
Copy link
Owner

owen2345 commented Mar 1, 2016

@fedemoretti
it should be simple by:

.container{ background: #ffffff asset-theme-url('img/patterns/pattern1.jpg'); }

tested in my local machine

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

3 participants