From db4947c1140354eb2d7d39d7dfb229989cc176b0 Mon Sep 17 00:00:00 2001 From: Kem Chen Date: Thu, 13 Mar 2025 10:48:40 +0800 Subject: [PATCH] Optimize comments.js file loading condition Co-authored-by: Mimi --- layout/_scripts/index.njk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/layout/_scripts/index.njk b/layout/_scripts/index.njk index 878a4c0..33212bb 100644 --- a/layout/_scripts/index.njk +++ b/layout/_scripts/index.njk @@ -1,6 +1,8 @@ {%- include 'vendors.njk' -%} -{{- next_js('comments.js') }} +{%- if theme.injects.comment.length > 1 %} + {{- next_js('comments.js') }} +{%- endif %} {{- next_js('utils.js') }} {%- if theme.motion.enable %}