mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 01:06:52 +00:00
Add Discourse for comments
This commit is contained in:
parent
a43ec05a4d
commit
d300a9dc44
@ -148,3 +148,6 @@ date_released: 2018-01-27
|
|||||||
# Major release:
|
# Major release:
|
||||||
patch_version_notes: "#"
|
patch_version_notes: "#"
|
||||||
# Minor release (Example #release-0431---april-25):
|
# Minor release (Example #release-0431---april-25):
|
||||||
|
|
||||||
|
# Date we moved to Discourse for comments
|
||||||
|
disqus_end_date: 2018-01-26 0:00:00
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<p class="meta">
|
<p class="meta">
|
||||||
{% include post/date.html %}{{ time }}
|
{% 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 %}
|
{% if site.disqus_short_name and page.comments != false and post.comments != false and site.disqus_show_comment_count == true %}
|
||||||
| <a href="{% if index %}{{ root_url }}{{ post.url }}{% endif %}#disqus_thread"
|
| <a href="{% if index %}{{ root_url }}{{ post.url }}{% endif %}#post-comments"
|
||||||
data-disqus-identifier="{% if post.meta.disqus_id %}{{ post.meta.disqus_id }}{% else %}{{ site.url }}{{ post.url }}{% endif %}">Comments</a>
|
data-disqus-identifier="{% if post.meta.disqus_id %}{{ post.meta.disqus_id }}{% else %}{{ site.url }}{{ post.url }}{% endif %}">Comments</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
{% include blog/post/tags.html %}
|
{% 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 %}
|
{% if site.disqus_short_name and page.comments != false and post.comments != false and site.disqus_show_comment_count == true %}
|
||||||
<a class='comments'
|
<a class='comments'
|
||||||
href="{% if index %}{{ root_url }}{{ post.url }}{% endif %}#disqus_thread"
|
href="{% if index %}{{ root_url }}{{ post.url }}{% endif %}#post-comments"
|
||||||
>Comments</a>
|
>Comments</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -4,7 +4,11 @@
|
|||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
|
|
||||||
{% include javascripts/google_analytics.html %}
|
{% 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 %}
|
{% include javascripts/disqus.html %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% include javascripts/algolia.html %}
|
{% include javascripts/algolia.html %}
|
||||||
|
|
||||||
{% if page.sidebar != false %}
|
{% if page.sidebar != false %}
|
||||||
|
@ -8,9 +8,26 @@ is_post: true
|
|||||||
{% include blog/post/article.html %}
|
{% include blog/post/article.html %}
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
{% if site.disqus_short_name and page.comments == true %}
|
<div id='post-comments'></div>
|
||||||
|
|
||||||
|
{% if site.disqus_short_name and post.date < site.disqus_end_date and page.comments == true %}
|
||||||
<section id="disqus">
|
<section id="disqus">
|
||||||
<h3 class="indent title">Comments</h3>
|
<h3 class="indent title">Comments</h3>
|
||||||
<div id="disqus_thread" aria-live="polite">{% include blog/post/disqus_thread.html %}</div>
|
<div id="disqus_thread" aria-live="polite">{% include blog/post/disqus_thread.html %}</div>
|
||||||
</section>
|
</section>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if page.comments == true and post.date > site.disqus_end_date %}
|
||||||
|
<div id='discourse-comments'></div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
DiscourseEmbed = { discourseUrl: 'https://community.home-assistant.io/',
|
||||||
|
discourseEmbedUrl: '{{ page.url | canonical_url }}' };
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
|
||||||
|
d.src = DiscourseEmbed.discourseUrl + 'javascripts/embed.js';
|
||||||
|
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
Loading…
x
Reference in New Issue
Block a user