diff options
-rw-r--r-- | assets/js/loads.js | 14 | ||||
-rw-r--r-- | layouts/partials/head.html | 13 |
2 files changed, 12 insertions, 15 deletions
diff --git a/assets/js/loads.js b/assets/js/loads.js index 71e0173..c8a03a7 100644 --- a/assets/js/loads.js +++ b/assets/js/loads.js @@ -1,4 +1,4 @@ -function load_js(url) { +function load_css(url) { let link = document.createElement("link"); link.rel = "stylesheet"; link.type = "text/css"; @@ -9,6 +9,16 @@ function load_js(url) { addEventListener("load", function () { if (document.querySelector(".highlight .chroma")) { - load_js("/css/syntax.css"); + load_css("/css/syntax.css"); } + + if (document.querySelector(".ai")) { + load_css( + "https://cdn.jsdelivr.net/gh/jpswalsh/academicons@1/css/academicons.min.css", + ); + } + if (document.querySelectorAll(".fa,.fab,.fas,.far")) + load_css( + "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css", + ); }); diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 638972b..f3919c4 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -12,19 +12,6 @@ /> {{ end }} - - <link - rel="stylesheet" - href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" - integrity="sha512-9usAa10IRO0HhonpyAIVpjrylPvoDwiPUiKdWk5t3PyolY1cOd4DSE0Ga+ri4AuTroPR5aQvXU9xC6qOPnzFeg==" - crossorigin="anonymous" - referrerpolicy="no-referrer" - /> - <link - rel="stylesheet" - href="https://cdn.jsdelivr.net/gh/jpswalsh/academicons@1/css/academicons.min.css" - /> - {{ with resources.Get .Site.Params.favicon }} <link rel="icon" href="{{ .RelPermalink }}" /> {{ end }} |