Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Following the instructions in https://github.com/damieng/jekyll-blog-comments to set up haacked.com to use a jekyll+azure based comment system.
- Loading branch information
Showing
11 changed files
with
137 additions
and
43 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,48 @@ | ||
<h3>Respond to this</h3> | ||
<form action="/fake" method="post" id="commentform" class="form-horizontal"> | ||
<input name="redirect" type="hidden" value="/thanks"> | ||
<input name="post_id" type="hidden" value="{{ slug }}"> | ||
<div id="commenttext"> | ||
<textarea name="comment" id="comment" placeholder="Continue the discussion."></textarea> | ||
</div> | ||
<div class="control-group"> | ||
<label for="name">Name/alias <span>(Required, displayed)</span></label> | ||
<input type="text" name="name" id="name" placeholder="Name" /> | ||
</div> | ||
<div class="control-group"> | ||
<label for="email">Email <span>(Required, not shown)</span></label> | ||
<input type="text" name="email" id="email" placeholder="myemail@somedomain.com" /> | ||
</div> | ||
<div class="control-group"> | ||
<label for="url">Website <span>(Optional, displayed)</span></label> | ||
<input type="text" name="url" id="url" placeholder="https://mywebsite.com" /> | ||
</div> | ||
<div class="control-group"> | ||
<label> </label> | ||
<button onclick="setupForm()" type="button" class="btn btn-primary" id="commentbutton">Leave response</button> | ||
</div> | ||
</form> | ||
<script> | ||
function setupForm() { | ||
var status = document.getElementById('commentstatus') | ||
status.innerText = '' | ||
var requiredIds = ['message', 'email', 'name'] | ||
var missing = requiredIds.filter(id => document.getElementById(id).value.length < 3) | ||
if (missing.length > 0) { | ||
status.innerText = 'Some required fields are missing - (' + missing.join(', ') + ')' | ||
return | ||
} | ||
var button = document.getElementById('commentbutton') | ||
if (button.innerText != 'Confirm comment') { | ||
button.innerText = 'Confirm comment' | ||
return | ||
} | ||
var form = document.getElementById('commentform') | ||
form.action = '{{ site.comments.receiver }}' | ||
button.innerText = 'Posting...' | ||
button.disabled = true | ||
form.submit() | ||
} | ||
</script> | ||
</form> | ||
<div id="commentstatus" style="clear:both" class="status"></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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{% if comment.url %} | ||
<a href="{{ comment.url }}" rel="nofollow"> | ||
<img alt="Gravatar for {{ comment.name | xml_escape }}" src="https://secure.gravatar.com/avatar/{{ comment.gravatar }}?s=64&d=retro&r=pg" srcset="https://secure.gravatar.com/avatar/{{ comment.gravatar }}?s=128&d=retro&r=pg 2x" class="avatar avatar-64 photo" height="64" width="64"> | ||
</a> | ||
{% else %} | ||
<img alt="Gravatar for {{ comment.name | xml_escape }}" src="https://secure.gravatar.com/avatar/{{ comment.gravatar }}?s=64&d=retro&r=pg" srcset="https://secure.gravatar.com/avatar/{{ comment.gravatar }}?s=128&d=retro&r=pg 2x" class="avatar avatar-64 photo" height="64" width="64"> | ||
{% endif %} | ||
|
||
<blockquote id="{{ comment.id }}"> | ||
<div class="comment-body">{{ comment.message | markdownify }}</div> | ||
<cite> | ||
{% if comment.url %} | ||
<a href="{{ comment.url }}" rel="nofollow">{{ comment.name | xml_escape }}</a> | ||
{% else %} | ||
{{ comment.name | xml_escape }} | ||
{% endif %} | ||
– | ||
<span 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' }} | ||
</span> | ||
</cite> | ||
</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,23 @@ | ||
{% 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 %} | ||
{% if comment_count > 0 %} | ||
{% assign author = site.authors[page.author] %} | ||
<div id="comments"> | ||
<h3>{% if comment_count == 1 %}One response{% else %}{{ comment_count }} responses{% endif %}</h3> | ||
<ol> | ||
{% assign sorted_comments = comments | sort: 'date' %} | ||
{% for comment in sorted_comments %} | ||
<li{% if comment.email == author.email %} class="byauthor" {% endif %}> | ||
{% include comment.html %} | ||
</li> | ||
{% endfor %} | ||
</ol> | ||
</div> | ||
{% endif %} | ||
{% include comment-new.html %} |
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
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
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