diff --git a/layout/_layout.njk b/layout/_layout.njk
index b1475a2..9dff4c5 100644
--- a/layout/_layout.njk
+++ b/layout/_layout.njk
@@ -4,9 +4,8 @@
{{ partial('_partials/head/head.njk', {}, {cache: theme.cache.enable}) }}
{%- include '_partials/head/head-unique.njk' -%}
{% block title %}{% endblock %}
- {{- next_js('config.js') }}
- {{- next_inject('head') }}
{{ partial('_third-party/analytics/index.njk', {}, {cache: theme.cache.enable}) }}
+ {{- next_inject('head') }}
diff --git a/layout/_partials/comments.njk b/layout/_partials/comments.njk
index 0d5a494..0171e0e 100644
--- a/layout/_partials/comments.njk
+++ b/layout/_partials/comments.njk
@@ -33,5 +33,3 @@
{%- endif %}
{%- endif %}
{%- endif %}
-
-{{- next_js('comments.js') }}
diff --git a/layout/_partials/head/head.njk b/layout/_partials/head/head.njk
index 1a4498f..f74a914 100644
--- a/layout/_partials/head/head.njk
+++ b/layout/_partials/head/head.njk
@@ -54,3 +54,4 @@
{%- endif %}
{{ next_data('main', next_config()) }}
+{{- next_js('config.js') }}
diff --git a/layout/_scripts/index.njk b/layout/_scripts/index.njk
index 6aea29c..6a3788b 100644
--- a/layout/_scripts/index.njk
+++ b/layout/_scripts/index.njk
@@ -1,5 +1,7 @@
{%- include 'vendors.njk' -%}
+{{- next_js('comments.js') }}
+
{{- next_js('utils.js') }}
{%- if theme.motion.enable %}
{{- next_js('motion.js') }}