From b75dd9e161e6018d45fb2f1771ca18aecc42d88f Mon Sep 17 00:00:00 2001 From: Yi Zeng Date: Sat, 30 Sep 2017 10:15:30 +1300 Subject: [PATCH 1/4] Add disqus example usage in _config.yml --- _config.yml | 8 ++++---- starter-kit/_config.yml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/_config.yml b/_config.yml index 658c6b816..a1f53b590 100644 --- a/_config.yml +++ b/_config.yml @@ -56,10 +56,10 @@ blog: footer_content: A gem-based responsive simple texture styled Jekyll theme. disqus: - shortname: - public_key: -google_analytics: -addthis_public_id: # AddThis sharing plugin. See http://www.addthis.com/ + shortname: # e.g. yizeng + public_key: # e.g. ULZ0b9TFefCUJHKQd4JCKv2v3u27YoG7YG8zXPewkWrT333Z0Se9YnxLzoV6VM8W +google_analytics: # e.g. 'UA-42456515-5' +addthis_public_id: # AddThis sharing plugin. See http://www.addthis.com/. E.g. ra-53329e27694534j5 paths: home: / diff --git a/starter-kit/_config.yml b/starter-kit/_config.yml index 2036d2b22..6486f16cf 100644 --- a/starter-kit/_config.yml +++ b/starter-kit/_config.yml @@ -57,10 +57,10 @@ blog: footer_content: A gem-based responsive simple texture styled Jekyll theme. disqus: - shortname: - public_key: -google_analytics: -addthis_public_id: # AddThis sharing plugin. See http://www.addthis.com/ + shortname: # e.g. yizeng + public_key: # e.g. ULZ0b9TFefCUJHKQd4JCKv2v3u27YoG7YG8zXPewkWrT333Z0Se9YnxLzoV6VM8W +google_analytics: # e.g. 'UA-42456515-5' +addthis_public_id: # AddThis sharing plugin. See http://www.addthis.com/. E.g. ra-53329e27694534j5 paths: home: / From 72515ecd504db75e55c25e720109cb06ef0febe3 Mon Sep 17 00:00:00 2001 From: Yi Zeng Date: Sat, 30 Sep 2017 10:16:24 +1300 Subject: [PATCH 2/4] Ensure same protocol when getting disqus scripts --- _includes/common/disqus.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_includes/common/disqus.html b/_includes/common/disqus.html index a5f2b195d..73e8e7865 100644 --- a/_includes/common/disqus.html +++ b/_includes/common/disqus.html @@ -6,7 +6,7 @@ $.ajax({ type: 'GET', - url: 'https://disqus.com/api/3.0/threads/set.jsonp', + url: '//disqus.com/api/3.0/threads/set.jsonp', data: { api_key: disqusPublicKey, forum: disqusShortname, @@ -24,7 +24,7 @@ $('.comments .show-hidden').on('click', function () { $.ajaxSetup({cache: true}); - $.getScript('http://' + disqusShortname + '.disqus.com/embed.js'); + $.getScript('//' + disqusShortname + '.disqus.com/embed.js'); $.ajaxSetup({cache: false}); $(this).remove(); }); From e7afe2e6233fb385dd52b319c9856562e7cd1bc4 Mon Sep 17 00:00:00 2001 From: Yi Zeng Date: Sat, 30 Sep 2017 10:17:01 +1300 Subject: [PATCH 3/4] Fix JS error when Google Analytics is not enabled --- _includes/blog/scripts.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/_includes/blog/scripts.html b/_includes/blog/scripts.html index e8071ba3c..9d6fd9dbf 100644 --- a/_includes/blog/scripts.html +++ b/_includes/blog/scripts.html @@ -26,7 +26,6 @@ }); $('footer .back-to-top, .gotop').on('click', function (event) { - sendGaEvent('Blog', 'Back to Top', event.currentTarget); event.preventDefault(); $('html, body').animate({ scrollTop: 0 @@ -35,7 +34,6 @@ }); $('.show-hidden').on('click', function () { - sendGaEvent('Post', 'Show Hidden', event.currentTarget); $(this).parent().next().toggleClass("hidden"); $(this).toggleClass("hidden"); }); @@ -45,6 +43,12 @@ {% if site.google_analytics %}