From 2a30d9a1eb5219e5335d1afdd214204d61ea6367 Mon Sep 17 00:00:00 2001 From: Frederic Hemberger Date: Wed, 21 Sep 2011 13:37:59 +0200 Subject: [PATCH] Refactored inclusion of disqus script - Added ARIA setting `aria-live="polite"` to comment output - Removed duplicate
from page/post templates - Moved blocking JavaScript loading to the end of the document body. - Merged JavaScript code for index and pages/posts using conditionals - Moved global JavaScript disqus variables into the anonymous function to stop pollution of global namespace --- .themes/classic/source/_includes/disqus.html | 22 +++++++++ .../source/_includes/post/disqus_thread.html | 12 ----- .themes/classic/source/_layouts/default.html | 1 + .themes/classic/source/_layouts/page.html | 2 +- .themes/classic/source/_layouts/post.html | 4 +- .themes/classic/source/index.html | 47 +++++++------------ 6 files changed, 44 insertions(+), 44 deletions(-) create mode 100644 .themes/classic/source/_includes/disqus.html diff --git a/.themes/classic/source/_includes/disqus.html b/.themes/classic/source/_includes/disqus.html new file mode 100644 index 0000000..4b91353 --- /dev/null +++ b/.themes/classic/source/_includes/disqus.html @@ -0,0 +1,22 @@ +{% comment %} Load script if disquss comments are enabled and `page.comments` is either empty (index) or set to true {% endcomment %} +{% if site.disqus_short_name and page.comments != false %} + +{% endif %} diff --git a/.themes/classic/source/_includes/post/disqus_thread.html b/.themes/classic/source/_includes/post/disqus_thread.html index f966f03..b1acd8c 100644 --- a/.themes/classic/source/_includes/post/disqus_thread.html +++ b/.themes/classic/source/_includes/post/disqus_thread.html @@ -1,13 +1 @@ -
- diff --git a/.themes/classic/source/_layouts/default.html b/.themes/classic/source/_layouts/default.html index 629468d..d84da44 100644 --- a/.themes/classic/source/_layouts/default.html +++ b/.themes/classic/source/_layouts/default.html @@ -9,6 +9,7 @@
+ {% include disqus.html %} {% include google_analytics.html %} {% include google_plus_one.html %} {% include twitter_sharing.html %} diff --git a/.themes/classic/source/_layouts/page.html b/.themes/classic/source/_layouts/page.html index dbf209c..20c1745 100644 --- a/.themes/classic/source/_layouts/page.html +++ b/.themes/classic/source/_layouts/page.html @@ -27,7 +27,7 @@ layout: default {% if site.disqus_short_name and page.comments == true %}

Comments

-
{% include post/disqus_thread.html %}
+
{% include post/disqus_thread.html %}
{% endif %} diff --git a/.themes/classic/source/_layouts/post.html b/.themes/classic/source/_layouts/post.html index ce8a5de..e81cc78 100644 --- a/.themes/classic/source/_layouts/post.html +++ b/.themes/classic/source/_layouts/post.html @@ -17,10 +17,10 @@ single: true {% endunless %} -{% if site.disqus_short_name and page.comments != false %} +{% if site.disqus_short_name and page.comments == true %}

Comments

-
{% include post/disqus_thread.html %}
+
{% include post/disqus_thread.html %}
{% endif %} diff --git a/.themes/classic/source/index.html b/.themes/classic/source/index.html index e7e9695..1e896b0 100644 --- a/.themes/classic/source/index.html +++ b/.themes/classic/source/index.html @@ -3,35 +3,24 @@ layout: default ---
-{% assign index = true %} -{% for post in paginator.posts %} -{% assign content = post.content %} -
- {% include article.html %} -
-{% endfor %} - -{% if site.disqus_short_name %} - -{% endif %} + {% assign index = true %} + {% for post in paginator.posts %} + {% assign content = post.content %} +
+ {% include article.html %} +
+ {% endfor %} +