Add includes for static-based comments powered by Staticman

- Configure Staticman with sane defaults
- Build comment form to capture new comments and ajax data to Staticman
- Build comments view that iterates over `_data/comments/post-slug/*.yml` files
This commit is contained in:
Michael Rose
2016-08-10 16:08:13 -04:00
parent fb32147148
commit fdcaf16e2f
5 changed files with 143 additions and 1 deletions

22
_includes/comment.html Normal file
View File

@@ -0,0 +1,22 @@
<article id="comment{{ include.index }}" class="js-comment comment">
<div class="comment__avatar-wrapper">
<img class="comment__avatar" src="https://www.gravatar.com/avatar/{{ include.email }}?d=mm&s=80">
</div>
<div class="comment__content-wrapper">
<h3 class="comment__author">
{% if (include.url) and (include.url != '@url') %}
<a rel="nofollow" href="{{ include.url }}">{{ include.name }}</a>
{% else %}
{{ include.name }}
{% endif %}
</h3>
<p class="comment__date">
{% if include.date %}
{% if include.index %}<a href="#comment{{ include.index }}">{% endif %}
<time datetime="{{ include.date | date_to_xmlschema }}">{{ include.date | date: "%B %d, %Y at %I:%M %p" }}</time>
{% if include.index %}</a>{% endif %}
{% endif %}
</p>
{{ include.message | markdownify }}
</div>
</article>