chinshr / lato-rails Goto Github PK
View Code? Open in Web Editor NEWI like the Lato font. I like the asset pipeline. If you do too, you're welcome.
License: MIT License
I like the Lato font. I like the asset pipeline. If you do too, you're welcome.
License: MIT License
Using Rails 5.1.5:
in _mixin.scss
the font-url is defined as "#{$FontPath}/#{FontType}/..."
however
sprockets using sass will not translate the path "assets/bold/lato-bold..."
into a digest in
production.
The correct path should be "bold/lato-bold..."
. (without assets and the backslash) in order
to get a digest.
It's hard to find documentation on this, but it's likely a sprockets convention which must be followed.
First off, thanks for creating this gem.
I am using Semantic-UI-Rails-LESS which defaults to using the Lato font. I am wanting to do development away from the internet so found this project to provide it through the asset pipeline.
I am using version 1.0.5
of lato-rails and have followed the README instructions for how to include it via Sprockets i.e. *= require lato
.
It works fine in development, i.e. the font are being served correctly from http://localhost:3000/assets/bold/lato-bold.woff2?v=1.0.0
However, when deploying to production (with asset compilation enabled) the font files cannot be found. The CSS tries to load the font files from https://popin-portraits.herokuapp.com/assets/regular/lato-regular.woff2?v=1.0.0 which doesn't exist. I assume that's because the fingerprint is missing. For example, normal images are served through the asset pipeline have URLs like https://popin-portraits.herokuapp.com/assets/logo-afe2c346aabb349f7b0860664d363b7f1c6477d84ea59d48afbd626365260a85.png.
While the code is private, you can access the login page at https://popin-portraits.herokuapp.com/ and see from the Web Inspector that the fonts are not being loaded.
I don't think it's anything to do with Semantic-UI-Rails-LESS, as the CSS generated by lato-rails seems to be incorrect. See line 1 of the generated CSS. However, I could be wrong.
I have had some experience with defining font-face
and I ran into an issue where my .scss
needed to use font-url()
instead of url()
to fix this exact issue. The URL where my custom font is loaded is http://cycling.harris.org.nz/assets/strava-8c03e79c77a5f9d8d09f6b37a8bbc83fb83510ce6135d8962c522db44a758849.ttf?. However, I see that you already use font-url()
.
Do you have any ideas? I'm now somewhat out of my depth! Again, sorry I can't share the code :(
Hi, could you pls. bump the gemspec, such that it supports Rails 5.2?
Best Regards
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.