forked from haacked/haacked.com
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request haacked#316 from Haacked/add-comment-system
Implement Jekyll Blog Comments Former-commit-id: 8bce6ac Former-commit-id: b87b5ff Former-commit-id: 8e1b28192658bf1a6bfa9602c8f1da9e069c0fa6 [formerly b4030cb43276b32bfaadc7e65df487fdcb30a4c4] Former-commit-id: 1372e684ab75e0eed6b53a6c9b31d65ec1ba2911
- Loading branch information
Showing
22 changed files
with
490 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<form action="/fake" data-action="{{ site.comments.receiver }}" method="post" id="commentform" class="form-horizontal comment-box"> | ||
<input name="redirect" type="hidden" value="{{site.url}}/thanks"> | ||
<input name="post_id" type="hidden" value="{{ slug }}"> | ||
<input name="comment-site" type="hidden" value="{{ site.url }}"> | ||
<div id="comment-box"> | ||
<img src="/images/comments/unknown-avatar.png" data-fallbacksrc="/images/comments/unknown-avatar.png" data-role="user-avatar" alt="avatar" class="avatar" id="avatarPreview" /> | ||
<div id="commenttext"> | ||
<div id="commentstatus" class="status"></div> | ||
<div contenteditable="PLAINTEXT-ONLY" tabindex="0" role="textbox" aria-multiline="true" data-role="editable" class="textarea" aria-label="Join the discussion..." id="comment-div"></div> | ||
<input type="hidden" name="message" id="message" data-required="true" value="" /> | ||
</div> | ||
</div> | ||
<div id="comment-author"> | ||
<div class="control-group"> | ||
<input type="hidden" name="avatar" id="avatarInput" /> | ||
<input type="text" name="name" id="name" placeholder="Display Name" title="Name displayed with your comment" data-required="true" /> | ||
<input type="text" name="identity" id="identity" placeholder="email/@twitter/github" data-required="true" value="" /> | ||
<span class="info-circle" title="Identity is used to generate an avatar image only. It is not submitted with the form."></span> | ||
<button type="button" id="commentbutton">Leave response</button> | ||
<div id="remember-me"> | ||
<input type="checkbox" name="remember" id="remember"><label for="remember">Remember me</label> | ||
<span class="info-circle" title="Stores your name and email in the browser so you don't have to fill out the form again. This does not set a cookie."></span> | ||
</div> | ||
</div> | ||
</div> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{% if comment.url %} | ||
<a href="{{ comment.url }}" rel="nofollow"> | ||
<img alt="Avatar for {{ comment.name | xml_escape }}" src="{{comment.avatar}}" class="avatar" height="48" width="48"> | ||
</a> | ||
{% else %} | ||
<img alt="Avatar for {{ comment.name | xml_escape }}" src="{{comment.avatar}}" class="avatar" height="48" width="48"> | ||
{% endif %} | ||
|
||
<blockquote id="{{ comment.id }}"> | ||
<cite> | ||
<span class="author"> | ||
{% if comment.url %} | ||
<a href="{{ comment.url }}" rel="nofollow">{{ comment.name | xml_escape }}</a> | ||
{% else %} | ||
{{ comment.name | xml_escape }} | ||
{% endif %} | ||
</span> | ||
<span class="bullet">•</span> | ||
<a href="#{{ comment.id }}" class="muted" title="{{ comment.date | date_to_rfc822 }}"> | ||
{{ comment.date | date: '%B' }} | ||
{% assign d = comment.date | date: "%-d" %} | ||
{% case d %} | ||
{% when '1' or '21' or '31' %}{{d}}st, | ||
{% when '2' or '22' %}{{d}}nd, | ||
{% when '3' or '23' %}{{d}}rd, | ||
{% else %}{{d}}th, | ||
{% endcase %} | ||
{{ comment.date | date: '%Y' }} | ||
</a> | ||
</cite> | ||
<div class="comment-body">{{ comment.message | markdownify }}</div> | ||
</blockquote> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{% capture default_slug %}{{ page.slug | default: (page.title | slugify) }}{% endcapture %} | ||
{% capture slug %}{{ (page.slug | fallback: default_slug) | downcase | replace: '.', '-' }}{% endcapture %} | ||
{% assign comments_map = site.data.comments[slug] %} | ||
{% assign comments = site.emptyArray %} | ||
{% for comment in comments_map %} | ||
{% assign comments = comments | push: comment[1] %} | ||
{% endfor %} | ||
{% assign comment_count = comments | size %} | ||
{% assign author = site.authors[page.author] %} | ||
<div id="comments"> | ||
<h2>Comments</h2> | ||
{% include comment-new.html %} | ||
<h3 id="comment-count">{% if comment_count == 1 %}One response{% else %}{{ comment_count }} responses{% endif %}</h3> | ||
<ol id="comments-list"> | ||
{% assign sorted_comments = comments | sort: 'date' %} | ||
{% for comment in sorted_comments %} | ||
<li{% if comment.name == author.name %} class="byauthor" {% endif %}> | ||
{% include comment.html %} | ||
</li> | ||
{% endfor %} | ||
</ol> | ||
</div> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,3 @@ | |
| <a href="/privacy">privacy</a> | ||
| <a href="/articles/blogtegrity">blogtegrity</a> | ||
</p> | ||
|
||
{% include disqus.html %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
{% if post.disqus_identifier %} | ||
{% assign disqus_identifier = post.disqus_identifier %} | ||
{% else %} | ||
{% assign disqus_identifier = page.disqus_identifier %} | ||
{% if post.comments or page.comments %} | ||
<span class="comments"><a href="{{ post.url }}#comments">comments</a></span> | ||
{% endif %} | ||
|
||
<span class="comments"><a href="{{ post.url }}#disqus_thread"{% if disqus_identifier %} data-disqus-identifier="{{ disqus_identifier }}"{% endif %}>comments</a></span> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
<div class="meta"> | ||
<span class="date">{% include post/date.html %}{{ time }}</span> | ||
<span class="tags">{% include post/categories.html %}</span> | ||
{% if site.disqus_short_name and site.disqus_show_comment_count == true %} | ||
{% include post/comments_link.html %} | ||
{% endif %} | ||
{% include post/comments_link.html %} | ||
<span class="edit">{% include post/edit.html %}</span> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.