Skip to content

Commit

Permalink
Don’t try to use criticalcss if none exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilto committed Feb 6, 2017
1 parent ee627bd commit 64422ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions _tmpl/_partials/head.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
<meta name="fullcss" content="/_css/all.css">

<?php
if( is_null( $_GET[ "nocrit" ] ) ) {
$critical = @file_get_contents("_css/critical.css" );
$criticalCssNotEmpty = $critical !== false && strlen($critical) !== 0;
if( is_null( $_GET[ "nocrit" ] ) && $criticalCssNotEmpty ) {
echo "<style>";
include( "_css/critical.css" );
echo $critical;
echo "</style>";
} else {
echo '<link rel="stylesheet" href="/_css/all.css">';
Expand Down
1 change: 1 addition & 0 deletions _tmpl/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

<nav class="social">
<a class="no-txt twitter" href="https://twitter.com/respimg">The RICG on Twitter</a>
<a href="https://ricg-slack.herokuapp.com"><img src="https://ricg-slack.herokuapp.com/badge.svg" alt="Join the RICG on Slack"></a>
</nav>
</div>

Expand Down

0 comments on commit 64422ec

Please sign in to comment.