Skip to content

Commit

Permalink
Defer loading of Chart.js script for the GitHub Repos page to improve…
Browse files Browse the repository at this point in the history
… performance
  • Loading branch information
udaysinh-git committed Dec 31, 2024
1 parent a2a9358 commit bd36920
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/_includes/layout.njk
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,17 @@
{% if title == "Contact" %}
<link rel="stylesheet" href="/styles/contact.css">
{% endif %}
{% if title == "GitHub Repos" %}
<script src="https://cdn.jsdelivr.net/npm/chart.js" defer></script>
{% endif %}

<!-- Defer non-critical CSS -->
<link rel="preload" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"></noscript>

<link rel="icon" href="data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2036%2036%22%3E%3Cpath%20fill%3D%22%23FFAC33%22%20d%3D%22M28.068%2031.355c-2.229%200-8.468.785-10.068%201.832-1.601-1.047-7.84-1.832-10.069-1.832-2.564%200-1.161%201.039-1.161%202.322S5.367%2036%207.931%2036c2.229%200%208.468-.785%2010.069-1.832C19.601%2035.215%2025.84%2036%2028.068%2036c2.565%200%201.161-1.04%201.161-2.322s1.405-2.323-1.161-2.323%22%2F%3E%3Cpath%20fill%3D%22%23292F33%22%20d%3D%22M31.73%2015.866c-1.25-2.499-3.152-4.995-4.942-6.723C24.337%203.711%2020.759%200%2018%200s-6.337%203.71-8.788%209.143c-1.791%201.729-3.693%204.224-4.943%206.724-2.438%204.876-3.116%2011.426-2.
<!-- Defer non-critical JS -->
<script src="https://cdn.jsdelivr.net/npm/chart.js" defer></script>
</head>
<body class="{{ theme }}">
<header>
Expand Down

0 comments on commit bd36920

Please sign in to comment.