mirror of https://github.com/lukechilds/docs.git
moxiegirl
6 years ago
30 changed files with 498 additions and 262 deletions
@ -0,0 +1,49 @@ |
|||
<article id="comment{% unless include.r %}{{ index | prepend: '-' }}{% else %}{{ include.index | prepend: '-' }}{% endunless %}" class="js-comment comment {% if include.name == site.author.name %}admin{% endif %} {% unless include.replying_to == 0 %}child{% endunless %}"> |
|||
<div class="comment__avatar"> |
|||
{% if include.avatar %} |
|||
<img src="{{ include.avatar }}" alt="{{ include.name | escape }}"> |
|||
{% elsif include.email %} |
|||
<img src="https://www.gravatar.com/avatar/{{ include.email }}?d=mm&s=60" srcset="https://www.gravatar.com/avatar/{{ include.email }}?d=mm&s=120 2x" alt="{{ include.name | escape }}"> |
|||
{% else %} |
|||
<img src="/assets/images/avatar-60.png" srcset="/assets/images/avatar-120.png 2x" alt="{{ include.name | escape }}"> |
|||
{% endif %} |
|||
</div> |
|||
<h3 class="comment__author-name"> |
|||
{% unless include.url == blank %} |
|||
<a rel="external nofollow" href="{{ include.url }}"> |
|||
{% if include.name == site.author.name %}<svg class="icon" width="20px" height="20px"><use xlink:href="#icon-mistake"></use></svg> {% endif %}{{ include.name }} |
|||
</a> |
|||
{% else %} |
|||
{% if include.name == site.author.name %}<svg class="icon" width="20px" height="20px"><use xlink:href="#icon-mistake"></use></svg> {% endif %}{{ include.name }} |
|||
{% endunless %} |
|||
</h3> |
|||
<div class="comment__timestamp"> |
|||
{% if include.date %} |
|||
{% if include.index %}<a href="#comment{% if r %}{{ index | prepend: '-' }}{% else %}{{ include.index | prepend: '-' }}{% endif %}" title="Permalink to this comment">{% endif %} |
|||
<time datetime="{{ include.date | date_to_xmlschema }}">{{ include.date | date: '%B %d, %Y' }}</time> |
|||
{% if include.index %}</a>{% endif %} |
|||
{% endif %} |
|||
</div> |
|||
<div class="comment__content"> |
|||
{{ include.message | markdownify }} |
|||
</div> |
|||
{% unless include.replying_to != 0 or page.comments_locked == true %} |
|||
<div class="comment__reply"> |
|||
<a rel="nofollow" class="btn" href="#comment-{{ include.index }}" onclick="return addComment.moveForm('comment-{{ include.index }}', '{{ include.index }}', 'respond', '{{ page.slug }}')">Reply to {{ include.name }}</a> |
|||
</div> |
|||
{% endunless %} |
|||
</article> |
|||
|
|||
{% capture i %}{{ include.index }}{% endcapture %} |
|||
{% assign replies = site.data.comments[page.slug] | sort | where_exp: 'comment', 'comment[1].replying_to == i' %} |
|||
{% for reply in replies %} |
|||
{% assign index = forloop.index | prepend: '-' | prepend: include.index %} |
|||
{% assign replying_to = reply[1].replying_to | to_integer %} |
|||
{% assign avatar = reply[1].avatar %} |
|||
{% assign email = reply[1].email %} |
|||
{% assign name = reply[1].name %} |
|||
{% assign url = reply[1].url %} |
|||
{% assign date = reply[1].date %} |
|||
{% assign message = reply[1].message %} |
|||
{% include comment.html index=index replying_to=replying_to avatar=avatar email=email name=name url=url date=date message=message %} |
|||
{% endfor %} |
@ -0,0 +1,9 @@ |
|||
<form method="POST" action="https://api.staticman.net/v2/entry/moxiegirl/docs.blockstack/master/comments"> |
|||
<input name="options[redirect]" type="hidden" value="http://127.0.0.1:4000/"> |
|||
<!-- e.g. "2016-01-02-this-is-a-post" --> |
|||
<input name="options[slug]" type="hidden" value="{{ page.slug }}"> |
|||
<label><input name="fields[name]" type="text">Name</label> |
|||
<label><input name="fields[email]" type="email">E-mail</label> |
|||
<label><textarea name="fields[message]"></textarea>Message</label> |
|||
<button type="submit">Go!</button> |
|||
</form> |
@ -0,0 +1,77 @@ |
|||
# Name of the property. You can have multiple properties with completely |
|||
# different config blocks for different sections of your site. |
|||
# For example, you can have one property to handle comment submission and |
|||
# another one to handle posts. |
|||
comments: |
|||
# (*) REQUIRED |
|||
# |
|||
# Names of the fields the form is allowed to submit. If a field that is |
|||
# not here is part of the request, an error will be thrown. |
|||
allowedFields: ["name", "email", "url", "message"] |
|||
|
|||
# (*) REQUIRED |
|||
# |
|||
# Name of the branch being used. Must match the one sent in the URL of the |
|||
# request. |
|||
branch: "master" |
|||
|
|||
# Text to use as the commit message or pull request title. Accepts placeholders. |
|||
commitMessage: "Add Staticman data" |
|||
|
|||
# (*) REQUIRED |
|||
# |
|||
# Destination path (filename) for the data files. Accepts placeholders. |
|||
filename: "entry{@timestamp}" |
|||
|
|||
# The format of the generated data files. Accepted values are "json", "yaml" |
|||
# or "frontmatter" |
|||
format: "yaml" |
|||
|
|||
# List of fields to be populated automatically by Staticman and included in |
|||
# the data file. Keys are the name of the field. The value can be an object |
|||
# with a `type` property, which configures the generated field, or any value |
|||
# to be used directly (e.g. a string, number or array) |
|||
generatedFields: |
|||
date: |
|||
type: date |
|||
options: |
|||
format: "timestamp-seconds" |
|||
|
|||
# Whether entries need to be appproved before they are published to the main |
|||
# branch. If set to `true`, a pull request will be created for your approval. |
|||
# Otherwise, entries will be published to the main branch automatically. |
|||
moderation: true |
|||
|
|||
# Name of the site. Used in notification emails. |
|||
name: "zbabystack.netlify.com" |
|||
|
|||
# Notification settings. When enabled, users can choose to receive notifications |
|||
# via email when someone adds a reply or a new comment. This requires an account |
|||
# with Mailgun, which you can get for free at http://mailgun.com. |
|||
#notifications: |
|||
# Enable notifications |
|||
#enabled: true |
|||
|
|||
# (!) ENCRYPTED |
|||
# |
|||
# Mailgun API key |
|||
#apiKey: "1q2w3e4r" |
|||
|
|||
# (!) ENCRYPTED |
|||
# |
|||
# Mailgun domain (encrypted) |
|||
#domain: "4r3e2w1q" |
|||
|
|||
# (*) REQUIRED |
|||
# |
|||
# Destination path (directory) for the data files. Accepts placeholders. |
|||
path: "_data/comments/{options.slug}" |
|||
|
|||
# Names of required fields. If any of these isn't in the request or is empty, |
|||
# an error will be thrown. |
|||
requiredFields: ["name", "email", "message"] |
|||
|
|||
# List of transformations to apply to any of the fields supplied. Keys are |
|||
# the name of the field and values are possible transformation types. |
|||
transforms: |
|||
email: md5 |
@ -0,0 +1,77 @@ |
|||
# Name of the property. You can have multiple properties with completely |
|||
# different config blocks for different sections of your site. |
|||
# For example, you can have one property to handle comment submission and |
|||
# another one to handle posts. |
|||
comments: |
|||
# (*) REQUIRED |
|||
# |
|||
# Names of the fields the form is allowed to submit. If a field that is |
|||
# not here is part of the request, an error will be thrown. |
|||
allowedFields: ["name", "email", "url", "message"] |
|||
|
|||
# (*) REQUIRED |
|||
# |
|||
# Name of the branch being used. Must match the one sent in the URL of the |
|||
# request. |
|||
branch: "master" |
|||
|
|||
# Text to use as the commit message or pull request title. Accepts placeholders. |
|||
commitMessage: "Add Staticman data" |
|||
|
|||
# (*) REQUIRED |
|||
# |
|||
# Destination path (filename) for the data files. Accepts placeholders. |
|||
filename: "entry{@timestamp}" |
|||
|
|||
# The format of the generated data files. Accepted values are "json", "yaml" |
|||
# or "frontmatter" |
|||
format: "yaml" |
|||
|
|||
# List of fields to be populated automatically by Staticman and included in |
|||
# the data file. Keys are the name of the field. The value can be an object |
|||
# with a `type` property, which configures the generated field, or any value |
|||
# to be used directly (e.g. a string, number or array) |
|||
generatedFields: |
|||
date: |
|||
type: date |
|||
options: |
|||
format: "timestamp-seconds" |
|||
|
|||
# Whether entries need to be appproved before they are published to the main |
|||
# branch. If set to `true`, a pull request will be created for your approval. |
|||
# Otherwise, entries will be published to the main branch automatically. |
|||
moderation: true |
|||
|
|||
# Name of the site. Used in notification emails. |
|||
name: "zbabystack.netlify.com" |
|||
|
|||
# Notification settings. When enabled, users can choose to receive notifications |
|||
# via email when someone adds a reply or a new comment. This requires an account |
|||
# with Mailgun, which you can get for free at http://mailgun.com. |
|||
#notifications: |
|||
# Enable notifications |
|||
#enabled: true |
|||
|
|||
# (!) ENCRYPTED |
|||
# |
|||
# Mailgun API key |
|||
#apiKey: "1q2w3e4r" |
|||
|
|||
# (!) ENCRYPTED |
|||
# |
|||
# Mailgun domain (encrypted) |
|||
#domain: "4r3e2w1q" |
|||
|
|||
# (*) REQUIRED |
|||
# |
|||
# Destination path (directory) for the data files. Accepts placeholders. |
|||
path: "_data/comments/{options.slug}" |
|||
|
|||
# Names of required fields. If any of these isn't in the request or is empty, |
|||
# an error will be thrown. |
|||
requiredFields: ["name", "email", "message"] |
|||
|
|||
# List of transformations to apply to any of the fields supplied. Keys are |
|||
# the name of the field and values are possible transformation types. |
|||
transforms: |
|||
email: md5 |
Loading…
Reference in new issue