aboutsummaryrefslogtreecommitdiffstats
path: root/assets
diff options
context:
space:
mode:
authorOscar Najera <hi@oscarnajera.com>2025-01-17 02:33:06 +0100
committerOscar Najera <hi@oscarnajera.com>2025-01-17 02:33:06 +0100
commit74bb8aaf6f0bddc866d0341d347f0d92ddf94a2b (patch)
tree5a0c8c6d466b58c667065ff4661f641651126797 /assets
parentde099f27f293ad1d482303644e02fb458f3f3502 (diff)
downloadhugo-minimalist-theme-74bb8aaf6f0bddc866d0341d347f0d92ddf94a2b.tar.gz
hugo-minimalist-theme-74bb8aaf6f0bddc866d0341d347f0d92ddf94a2b.tar.bz2
hugo-minimalist-theme-74bb8aaf6f0bddc866d0341d347f0d92ddf94a2b.zip
load icons css with delay
Diffstat (limited to 'assets')
-rw-r--r--assets/js/loads.js14
1 files changed, 12 insertions, 2 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",
+ );
});