diff options
| author | Eltrac <hi@guhub.cn> | 2025-10-28 10:53:01 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-10-28 10:53:01 +0800 |
| commit | c1fe34f2476a0a1e52e70c996f8b07a4119ebf32 (patch) | |
| tree | bf22006e4102b4b0369b2f51647b33f85c773399 | |
| parent | 22c3e1795d987d2fec000ca0ba68c57b5e4bfca2 (diff) | |
perf: load giscus in idle time
| -rw-r--r-- | layouts/_partials/posts/comment.html | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/layouts/_partials/posts/comment.html b/layouts/_partials/posts/comment.html index 8a08e816..78621c22 100644 --- a/layouts/_partials/posts/comment.html +++ b/layouts/_partials/posts/comment.html @@ -56,5 +56,5 @@ function loadGiscus() { document.body.appendChild(script); } -document.addEventListener('DOMContentLoaded', loadGiscus); +window.addEventListener("load", () => { requestIdleCallback(() => loadGiscus()); }); </script> |
