Skip to content

Commit

Permalink
Changed the code to use synchronous web font loading to avoid the Fla…
Browse files Browse the repository at this point in the history
…sh of Unstyled Content. I based the code off the instructions under Get Started on https://github.com/typekit/webfontloader
  • Loading branch information
rphaedrus committed Jul 13, 2015
1 parent 3cd69c3 commit 0acc356
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,19 @@
<link rel="stylesheet" href="{{ site.url }}{{ site.baseurl }}/assets/css/styles_feeling_responsive.css">
<script src="{{ site.url }}{{ site.baseurl }}/assets/js/modernizr.min.js"></script>

<script src="https://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js"></script>
<script>
WebFontConfig = {
google: { families: [ 'Lato:400,700,400italic:latin', 'Volkhov::latin' ] }
};

(function() {
var wf = document.createElement('script');
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
'://ajax.googleapis.com/ajax/libs/webfont/1.5.6/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
WebFont.load({
google: {
families: [ 'Lato:400,700,400italic:latin', 'Volkhov::latin' ]
}
});
</script>

<noscript>
<link href='http://fonts.googleapis.com/css?family=Lato:400,700,400italic%7cVolkhov' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Lato:400,700,400italic|Volkhov' rel='stylesheet' type='text/css'>
</noscript>

{% if site.google_site_verification %}<meta name="google-site-verification" content="{{ site.google_site_verification}}" />{% endif %}
{% if site.bing_webmastertools_id %}<meta name="msvalidate.01" content="{{ site.bing_webmastertools_id }}" />{% endif %}
{% if page.meta_description %}<meta name="description" content="{{ page.meta_description | strip_html | escape }}"/>{% elsif page.teaser %}<meta name="description" content="{{ page.teaser | strip_html | escape }}"/>{% elsif site.description %}<meta name="description" content="{{ site.description | strip_html | escape }}"/>{% endif %}
Expand Down

0 comments on commit 0acc356

Please sign in to comment.