Last active
July 15, 2018 04:47
-
-
Save evert/409f5effca5e7fe706bd1c3aad13af9d to your computer and use it in GitHub Desktop.
Embedding comments from _data/comments.json with Jekyll / GH Pages
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
<li> | |
{% if include.comment.url %}<a href="{{ include.comment.url }}">{% endif %} | |
{% if include.comment.avatar %}<img src="{{ include.comment.avatar }}" alt="{{ include.comment.name }}" />{% end | |
{% if include.comment.url %}</a>{% endif %} | |
{% if include.comment.url %}<a href="{{ include.comment.url }}">{% endif %} | |
<span class="author">{{ include.comment.name }}</span> | |
{% if include.comment.url %}</a>{% endif %} | |
• <time>{{ include.comment.created | date: "%b %d, %Y" }}</time> | |
{{ include.comment.message }} | |
{% if include.comment.children %} | |
<ul> | |
{% for child in include.comment.children %} | |
{% include comment-single.html comment=child %} | |
{% endfor %} | |
</ul> | |
{% endif %} | |
</li> |
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
<ul> | |
{% for comment in include.comments %} | |
{% include comment-single.html comment=comment %} | |
{% endfor %} | |
</ul> |
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
{% assign comments = site.data.comments[page.id] %} | |
{% include comments.html comments=comments %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment