correct font preloading

This commit is contained in:
Sam 2017-04-20 11:18:37 -04:00
parent 8628a57f4e
commit bbed29ba57
1 changed files with 3 additions and 2 deletions

View File

@ -9,12 +9,13 @@
%>
<% font_domain = "#{request.protocol}#{request.host_with_port}&2" %>
<% woff2_url = "#{asset_path("fontawesome-webfont.woff2")}?#{font_domain}&v=4.5.0".html_safe %>
<link rel="preload" href="<%=asset_path "fontawesome-webfont.woff2"%>" as="font" type="font/woff2" crossorigin />
<link rel="preload" href="<%=woff2_url%>" as="font" type="font/woff2" crossorigin />
<style>
@font-face {
font-family: 'FontAwesome';
src: url('<%=asset_path "fontawesome-webfont.woff2" %>?<%= font_domain %>&v=4.5.0') format('woff2'),
src: url('<%=woff2_url %>') format('woff2'),
url('<%=asset_path "fontawesome-webfont.woff" %>?<%= font_domain %>&v=4.5.0') format('woff');
}
</style>