Skip to content

Commit

Permalink
Fix deploy issues on github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
rampatra committed Mar 1, 2023
1 parent b8fe697 commit 427c51e
Showing 1 changed file with 29 additions and 6 deletions.
35 changes: 29 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,31 @@
<html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en"> <!--<![endif]-->
<script>
// load css files from CDN if local node_modules fail
function loadCssFromCDN(css) {
// create new link tag
const link = document.createElement('link');
if (css === 'animate.css') {
link.href = 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.2/animate.min.css';
} else if (css === 'font-awesome.css') {
link.href = 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css';
}
link.rel = 'stylesheet';

// add link tag to head section
document.getElementsByTagName('head')[0].appendChild(link);
}

// load js files from CDN if local node_modules fail
function loadJsFromCDN(js) {
if (js === 'waypoints.js') {
document.write('<script src="https://github.com/imakewebthings/waypoints/blob/4.0.1/lib/jquery.waypoints.min.js"><\/script>');
} else if (js === 'jquery.js') {
document.write('<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"><\/script>');
}
}
</script>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
Expand All @@ -29,8 +54,8 @@
<link rel="stylesheet" href="css/flexslider.css">
<link rel="stylesheet" href="css/styles.min.css">
<link rel="stylesheet" href="css/queries.css">
<link rel="stylesheet" href="node_modules/animate.css/animate.min.css">
<link rel="stylesheet" href="node_modules/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="node_modules/animate.css/animate.min.css" onerror="loadCssFromCDN('animate.css')">
<link rel="stylesheet" href="node_modules/font-awesome/css/font-awesome.min.css" onerror="loadCssFromCDN('font-awesome.css')">
<script src="js/vendor/modernizr-2.8.3-respond-1.4.2.min.js"></script>
</head>
<body id="top">
Expand Down Expand Up @@ -470,14 +495,12 @@ <h3>What are you waiting for?</h3>
</div>
</div>
</footer>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.2.min.js"><\/script>')</script>
<script src="js/vendor/jquery-1.11.2.min.js" onerror="loadJsFromCDN('jquery.js')"></script>
<script src="node_modules/waypoints/lib/jquery.waypoints.min.js" onerror="loadJsFromCDN('waypoints.js')"></script>
<script src="js/jquery.fancybox.pack.js"></script>
<script src="js/vendor/bootstrap.min.js"></script>
<script src="js/jquery.flexslider-min.js"></script>
<script src="js/jquery.mb.YTPlayer.min.js"></script>
<script src="node_modules/waypoints/lib/jquery.waypoints.min.js"></script>
<script src="js/vendor/ouical.js"></script>
<script src="js/scripts.min.js"></script>
<script async defer
Expand Down

0 comments on commit 427c51e

Please sign in to comment.