From ffd264f5e61fc16fb2461efb193f8b19ffe3c38d Mon Sep 17 00:00:00 2001 From: Robert McGovern Date: Tue, 5 Nov 2024 19:07:43 +0000 Subject: [PATCH] Stopped the disqus JS being loaded on the front page. Noticed that every hit to the front page was attempting to download the embed.js from disqus. I have modified the template so that it is only loaded on a post page (where it should have been in the first place) --- .vscode/launch.json | 28 ++++++++++++++++++++++++++++ src/_includes/layouts/default.html | 3 --- src/_includes/layouts/single.html | 1 + src/_includes/scripts.html | 2 +- 4 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..2ad52f6 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,28 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + + + { + "type": "edge", + "version": "stable", + "request": "launch", + "name": "Launch Edge against localhost", + "url": "http://localhost:8080", + "webRoot": "${workspaceFolder}" + }, + { + "name": "11ty", + "type": "node", + "request": "launch", + "program": "${workspaceRoot}/node_modules/.bin/eleventy", + "stopOnEntry": false, + "args": ["--watch"], + "cwd": "${workspaceRoot}", + "console": "internalConsole" + } + ] +} \ No newline at end of file diff --git a/src/_includes/layouts/default.html b/src/_includes/layouts/default.html index 57f1592..c9c1975 100644 --- a/src/_includes/layouts/default.html +++ b/src/_includes/layouts/default.html @@ -35,8 +35,5 @@ {% include footer.html %} - - {% include scripts.html %} - diff --git a/src/_includes/layouts/single.html b/src/_includes/layouts/single.html index baeac74..42df8a4 100644 --- a/src/_includes/layouts/single.html +++ b/src/_includes/layouts/single.html @@ -74,6 +74,7 @@ layout: default {% endcomment %} {% if site.comments.provider and comments or site.defaults.posts.comments %} {% include comments.html %} + {% include comments-providers/scripts.html %} {% endif %} diff --git a/src/_includes/scripts.html b/src/_includes/scripts.html index d05383a..6208ffe 100644 --- a/src/_includes/scripts.html +++ b/src/_includes/scripts.html @@ -19,7 +19,7 @@ {% endif %} {% include analytics.html %} -{% include comments-providers/scripts.html %} + {% if site.after_footer_scripts %} {% for script in site.after_footer_scripts %}