Commit 5e8981e2 authored by Jamie Tanna's avatar Jamie Tanna

Merge branch 'feature/webmentions' into 'fork'

Render sent webmentions

See merge request !27
parents 4b1408f7 398ea39e
......@@ -11,3 +11,4 @@
@import 'tale/talk';
@import 'tale/divider';
@import 'tale/microformats';
@import 'tale/webmentions';
.webmentions {
.facepile {
img {
display: inline-block;
height: 32px;
margin: 0;
width: 32px;
}
}
.likes {
ul li {
display: inline-block;
list-style: none;
}
}
}
......@@ -56,6 +56,7 @@
{{ end }}
{{- end -}}
{{ partial "webmention.html" . }}
</div>
<div class="pagination">
......
{{ $url := printf "%s%s" .Site.Params.LiveSiteUrl .URL }}
{{ $webmentions := getJSON (printf .Site.Params.WebMentionFormatUrl $url) }}
{{ if gt (len $webmentions.children) 0 }}
{{ $likes := slice }}
{{ $reposts := slice }}
{{ $replies := slice }}
{{ $mentions := slice }}
{{ $bookmarks := slice }}
{{ $rsvps := slice }}
{{ range $webmentions.children }}
{{ if eq "like-of" (index . "wm-property") }}
{{ $likes = $likes | append . }}
{{ end }}
{{ if eq "repost-of" (index . "wm-property") }}
{{ $reposts = $reposts | append . }}
{{ end }}
{{ if eq "in-reply-to" (index . "wm-property") }}
{{ $replies = $replies | append . }}
{{ end }}
{{ if eq "mention-of" (index . "wm-property") }}
{{ $mentions = $mentions | append . }}
{{ end }}
{{ if eq "bookmark-of" (index . "wm-property") }}
{{ $bookmarks = $bookmarks | append . }}
{{ end }}
{{ if eq "rsvp" (index . "wm-property") }}
{{ $rsvps = $rsvps | append . }}
{{ end }}
{{ end }}
<div class="webmentions">
<h2>Interactions with this post</h2>
<p>This post has had {{ len $webmentions.children }} <a href="http://indieweb.org/webmention">WebMention</a> interactions, as of {{ now.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}.</p>
{{ partial "webmention/likes.html" $likes }}
{{ partial "webmention/mentions.html" $mentions }}
{{ partial "webmention/reposts.html" $reposts }}
{{ partial "webmention/replies.html" $replies }}
{{ partial "webmention/bookmarks.html" $bookmarks }}
{{ partial "webmention/rsvps.html" $rsvps }}
</div>
{{ end }}
{{ if gt (len .) 0 }}
<div class="bookmarks">
<h3>Bookmarks</h3>
<ul>
{{ range . }}
<li>
<a href="{{ .author.url }}">{{ .author.name }}</a> bookmarked this post in <a href="{{ .url }}">{{ .url }}</a> on {{ dateFormat "02 January 2006" .published }}.
</li>
{{ end }}
</ul>
</div>
{{ end }}
{{ if gt (len .) 0 }}
<div class="likes">
<h3>Likes</h3>
<ul class="facepile">
{{ range . }}
<li>
<a href="{{ .url }}">
<img src=" {{ .author.photo }}" alt="{{ .author.name }}'s photo" />
</a>
</li>
{{ end }}
</ul>
</div>
{{ end }}
{{ if gt (len .) 0 }}
<div class="mentions">
<h3>Mentions</h3>
<ul>
{{ range . }}
<li>
<a href="{{ .author.url }}">{{ .author.name }}</a> mentioned this post at <a href="{{ .url }}">{{ .url }}</a> on {{ dateFormat "02 January 2006" .published }}.
</li>
{{ end }}
</ul>
</div>
{{ end }}
{{ if gt (len .) 0 }}
<div class="replies">
<h3>Replies</h3>
<ul>
{{ range . }}
<li>
<a href="{{ .author.url }}">{{ .author.name }}</a> wrote a reply to this post at <a href="{{ .url }}">{{ .url }}</a> on {{ dateFormat "02 January 2006" .published }}.
</li>
{{ end }}
</ul>
</div>
{{ end }}
{{ if gt (len .) 0 }}
<div class="reposts">
<h3>Reposts</h3>
<ul>
{{ range . }}
<li>
<a href="{{ .author.url }}">{{ .author.name }}</a> reposted this at <a href="{{ .url }}">{{ .url }}</a> on {{ dateFormat "02 January 2006" .published }}.
</li>
{{ end }}
</ul>
</div>
{{ end }}
{{ if gt (len .) 0 }}
<div class="rsvps">
<h3>RSVPs</h3>
<ul>
{{ range . }}
<li>
<a href="{{ .author.url }}">{{ .author.name }}</a> RSVP'd <code>{{ .rsvp }}</code> to this event <a href="{{ .url }}">{{ .url }}</a> on {{ dateFormat "02 January 2006" .published }}.
</li>
{{ end }}
</ul>
</div>
{{ end }}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment