diff --git a/layout/_scripts/index.njk b/layout/_scripts/index.njk index 6a3788b86..378cb369c 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 > 0 %} + {{- next_js('comments.js') }} +{%- endif %} {{- next_js('utils.js') }} {%- if theme.motion.enable %}