diff --git a/_config.yml b/_config.yml index 8035041d..3be0ef38 100644 --- a/_config.yml +++ b/_config.yml @@ -24,12 +24,24 @@ facebook: username : &facebook "site_facebook" app_id : publisher : -disqus_shortname : "mmistakes-dev" # https://help.disqus.com/customer/portal/articles/466208-what-s-a-shortname- +comments: + provider : false # false (default), "disqus", "facebook", "google-plus", custom" + disqus: + shortname : "mmistakes-dev" # https://help.disqus.com/customer/portal/articles/466208-what-s-a-shortname- + facebook: + # https://developers.facebook.com/docs/plugins/comments + appid : + num_posts : # 5 (default) + width : # 580 (default) + colorscheme : # "light" (default), "dark" google_site_verification : bing_site_verification : alexa_site_verification : yandex_site_verification : -google_analytics : # Universal Analytics tracking ID +analytics: + provider : false # false (default), "google", "google-universal", "custom" + google: + tracking_id : "UA-123456-7" google_ad_client : google_ad_slot : diff --git a/_includes/analytics b/_includes/analytics new file mode 100644 index 00000000..295516aa --- /dev/null +++ b/_includes/analytics @@ -0,0 +1,12 @@ +{% if site.analytics.provider and page.analytics != false %} + +{% case site.analytics.provider %} +{% when "google" %} + {% include /analytics-providers/google %} +{% when "google-universal" %} + {% include /analytics-providers/google-universal %} +{% when "custom" %} + {% include /analytics-providers/custom %} +{% endcase %} + +{% endif %} \ No newline at end of file diff --git a/_includes/analytics-providers/custom b/_includes/analytics-providers/custom new file mode 100644 index 00000000..c34b97ad --- /dev/null +++ b/_includes/analytics-providers/custom @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/_includes/analytics-providers/google b/_includes/analytics-providers/google new file mode 100644 index 00000000..b591b995 --- /dev/null +++ b/_includes/analytics-providers/google @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/_includes/analytics-providers/google-universal b/_includes/analytics-providers/google-universal new file mode 100644 index 00000000..8da1929c --- /dev/null +++ b/_includes/analytics-providers/google-universal @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/_includes/comments b/_includes/comments new file mode 100644 index 00000000..a549d8e7 --- /dev/null +++ b/_includes/comments @@ -0,0 +1,14 @@ +{% if site.comments.provider and page.comments %} + +{% case site.comments.provider %} +{% when "disqus" %} + {% include /comments-providers/disqus %} +{% when "facebook" %} + {% include /comments-providers/facebook %} +{% when "google-plus" %} + {% include /comments-providers/google-plus %} +{% when "custom" %} + {% include /comments-providers/custom %} +{% endcase %} + +{% endif %} \ No newline at end of file diff --git a/_includes/comments-providers/custom b/_includes/comments-providers/custom new file mode 100644 index 00000000..90993691 --- /dev/null +++ b/_includes/comments-providers/custom @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/_includes/comments-providers/disqus b/_includes/comments-providers/disqus new file mode 100644 index 00000000..b80be9ef --- /dev/null +++ b/_includes/comments-providers/disqus @@ -0,0 +1,22 @@ +{% if site.comments.disqus.shortname %} + + +{% endif %} diff --git a/_includes/comments-providers/facebook b/_includes/comments-providers/facebook new file mode 100644 index 00000000..009dc1c6 --- /dev/null +++ b/_includes/comments-providers/facebook @@ -0,0 +1,8 @@ +
+ \ No newline at end of file diff --git a/_includes/comments-providers/google-plus b/_includes/comments-providers/google-plus new file mode 100644 index 00000000..cd582c3d --- /dev/null +++ b/_includes/comments-providers/google-plus @@ -0,0 +1,2 @@ + + diff --git a/_includes/disqus-comments b/_includes/disqus-comments deleted file mode 100644 index 721316a1..00000000 --- a/_includes/disqus-comments +++ /dev/null @@ -1,22 +0,0 @@ -{% if site.disqus_shortname %} - - -{% endif %} diff --git a/_includes/scripts b/_includes/scripts index c8b4714e..dfe7ba46 100644 --- a/_includes/scripts +++ b/_includes/scripts @@ -2,19 +2,5 @@ -{% if site.google_analytics %} - -{% endif %} - -{% if page.comments %} - {% include disqus-comments %} -{% endif %} +{% include analytics %} +{% include comments %} diff --git a/_layouts/single.html b/_layouts/single.html index 5cc99dac..31648567 100644 --- a/_layouts/single.html +++ b/_layouts/single.html @@ -32,8 +32,17 @@ layout: default - {% if site.disqus_shortname and page.comments %} -
+ {% if site.comments.provider and page.comments %} + {% case site.comments.provider %} + {% when "disqus" %} +
+ {% when "facebook" %} +
+ {% when "google-plus" %} +
Loading Google+ Comments ...
+ {% when "custom" %} +
+ {% endcase %} {% endif %}