Browse Source

can only test comments in live

master
jk 4 years ago
parent
commit
a349c66a70
  1. 25
      themes/nipponalba/layouts/_default/single.html
  2. 20
      themes/nipponalba/layouts/partials/webmention.html

25
themes/nipponalba/layouts/_default/single.html

@ -29,7 +29,7 @@
<div class="date"><time class="dt-published" datetime="{{ .Date.Format "2 Jan 2006 15:04 GMT" }}">{{ .Date.Format "Mon, Jan 2, 2006" }}</time></div> <div class="date"><time class="dt-published" datetime="{{ .Date.Format "2 Jan 2006 15:04 GMT" }}">{{ .Date.Format "Mon, Jan 2, 2006" }}</time></div>
{{ $pathJSON := (print .Permalink "bridgy.json") }} {{ $pathJSON := (print .Permalink "bridgy.json") }}
{{ $relpathJSON := (print .RelPermalink "bridgy.json") }} {{ $relpathJSON := (print .RelPermalink "bridgy.json") }}
{{ if fileExists $relpathJSON }}
{{ if fileExists $pathJSON }}
<div class="syndication"> <div class="syndication">
{{ $mJSON := getJSON $pathJSON }} {{ $mJSON := getJSON $pathJSON }}
Syndicated to <a href="{{ printf $mJSON.url}}">Pleroma</a> Syndicated to <a href="{{ printf $mJSON.url}}">Pleroma</a>
@ -42,14 +42,21 @@
</div> </div>
</div> </div>
<a href="https://brid.gy/publish/mastodon"></a> <a href="https://brid.gy/publish/mastodon"></a>
{{ if eq .Type "article"}}
{{ if .Site.DisqusShortname -}}
<div id="fb_comments_container">
<h2>Comments</h2>
{{ template "_internal/disqus.html" . }}
</div>
{{- end }}
{{ end }}
<div class="webmention-form">
<form action="https://webmention.io/deluvi.com/webmention" method="post">
<label>Did you mention this article on your website? Put the URL of your post here:</label><br/>
<input name="source" type="url"/>
<input name="target" value="{{ .Permalink }}" type="hidden"/>
<input value="Send Webmention" type="submit"/>
</form>
</div>
{{ $pathJSON := (print "data" (strings.TrimSuffix "/" .Permalink) ".json") }}
{{ if fileExists $pathJSON }}
<div class="webmentions">
{{ $mJSON := getJSON $pathJSON }}
{{ partial "webmention.html" $mJSON }}
</div>
{{ end }}
</aside></div> </aside></div>
</article> {{ else }} </article> {{ else }}

20
themes/nipponalba/layouts/partials/webmention.html

@ -0,0 +1,20 @@
{{ range . }}
{{ if eq .mention_type "mention" }}
<div class="mention"><a href="{{ .author.url }}">{{ .author.name }}</a> mentioned this post in <a href="{{ .url }}">the post {{ .title }}</a></div>
{{ end }}
{{ if eq .mention_type "like" }}
<div class="like"><a href="{{ .author.url }}">{{ .author.name }}</a> <a href="{{ .url }}">liked</a></div>
{{ end }}
{{ if eq .mention_type "reply" }}
<div class="reply"><a href="{{ .author.url }}">{{ .author.name }}</a> replied to this post <a href="{{ .url }}">here</a></div>
{{ end }}
{{ if eq .mention_type "bookmark" }}
<div class="bookmark"><a href="{{ .author.url }}">{{ .author.name }}</a> bookmarked this post</div>
{{ end }}
{{ if eq .mention_type "repost" }}
<div class="repost"><a href="{{ .author.url }}">{{ .author.name }}</a> <a href="{{ .url }}">reposted</a> this article</div>
{{ end }}
{{ if eq .mention_type "rsvp" }}
<div class="rsvp"><a href="{{ .author.url }}">{{ .author.name }}</a> responded to the rsvp <a href="{{ .url }}">here</a></div>
{{ end }}
{{ end }}