From d300a9dc44f074e2688171f02e16474caa5930bf Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 27 Jan 2018 00:30:24 -0800 Subject: [PATCH] Add Discourse for comments --- _config.yml | 3 +++ source/_includes/article.html | 2 +- source/_includes/blog/post/article.html | 2 +- source/_includes/javascripts/scripts.html | 4 ++++ source/_layouts/post.html | 19 ++++++++++++++++++- 5 files changed, 27 insertions(+), 3 deletions(-) diff --git a/_config.yml b/_config.yml index 673e9d8eacd..732f3e54776 100644 --- a/_config.yml +++ b/_config.yml @@ -148,3 +148,6 @@ date_released: 2018-01-27 # Major release: patch_version_notes: "#" # Minor release (Example #release-0431---april-25): + +# Date we moved to Discourse for comments +disqus_end_date: 2018-01-26 0:00:00 diff --git a/source/_includes/article.html b/source/_includes/article.html index b7a6e0e2edb..f88d16cc9c4 100644 --- a/source/_includes/article.html +++ b/source/_includes/article.html @@ -9,7 +9,7 @@

{% include post/date.html %}{{ time }} {% if site.disqus_short_name and page.comments != false and post.comments != false and site.disqus_show_comment_count == true %} - | Comments {% endif %}

diff --git a/source/_includes/blog/post/article.html b/source/_includes/blog/post/article.html index 2cef69f00ea..ed236247662 100644 --- a/source/_includes/blog/post/article.html +++ b/source/_includes/blog/post/article.html @@ -15,7 +15,7 @@ {% include blog/post/tags.html %} {% if site.disqus_short_name and page.comments != false and post.comments != false and site.disqus_show_comment_count == true %} Comments {% endif %} diff --git a/source/_includes/javascripts/scripts.html b/source/_includes/javascripts/scripts.html index 32903641a22..71b49ae662e 100644 --- a/source/_includes/javascripts/scripts.html +++ b/source/_includes/javascripts/scripts.html @@ -4,7 +4,11 @@ {% endcomment %} {% include javascripts/google_analytics.html %} + +{% if site.disqus_short_name and post.date < site.disqus_end_date and page.comments == true %} {% include javascripts/disqus.html %} +{% endif %} + {% include javascripts/algolia.html %} {% if page.sidebar != false %} diff --git a/source/_layouts/post.html b/source/_layouts/post.html index 9d5c8e41ad5..3ba1b0b4e6b 100644 --- a/source/_layouts/post.html +++ b/source/_layouts/post.html @@ -8,9 +8,26 @@ is_post: true {% include blog/post/article.html %} -{% if site.disqus_short_name and page.comments == true %} +
+ +{% if site.disqus_short_name and post.date < site.disqus_end_date and page.comments == true %}

Comments

{% include blog/post/disqus_thread.html %}
+{% endif %} + +{% if page.comments == true and post.date > site.disqus_end_date %} +
+ + {% endif %} \ No newline at end of file