Commit 1f2f99ef authored by Kaushal Modi's avatar Kaushal Modi

Support link-only mentions where the author_obj is nil

parent 863536c9
......@@ -35,18 +35,19 @@
{{ $activity_type := (index $activity "type") }}
{{ $data := (index $wm "data") }}
{{/* partial "debugprint.html" $data */}}
{{ $author_obj := (index $data "author") }}
{{ $author_name := (index $author_obj "name") }}
{{ $author_photo := (index $author_obj "photo") }}
{{ $author_url := (index $author_obj "url") }}
{{ $mention_content := (index $data "content") }}
{{ $mention_url := (index $data "url") }}
{{ $mention_content := (index $data "content") }}
{{ with (index $data "published") }}
{{ $.Scratch.Set "__published_date" ((time .).Local | dateFormat "Mon Jan 2, 2006") }}
{{ end }}
{{ with (index $wm "verified_date") }} <!-- Webmention received date -->
{{ $.Scratch.Set "__verified_date" ((time .).Local | dateFormat "Mon Jan 2, 2006 15:04 MST") }}
{{ end }}
{{ $author_obj := (index $data "author") }}
{{ with $author_obj }}
{{ $author_name := (index . "name") }}
{{ $author_photo := (index . "photo") }}
{{ $author_url := (index . "url") }}
{{ if (eq $activity_type "reply") }}
{{/* partial "debugprint.html" $data */}}
<dl class="webmention comment">
......@@ -96,6 +97,18 @@
{{ else }}
{{ $activity }}
{{ end }}
{{ else }}
{{ with $mention_url }}
<dl class="webmention mention">
<dt>
Mentioned at
</dt>
<dd>
{{ printf `<a href="%s" class="no-text-decoration">%s</a>` . . | safeHTML }}
</dd>
</dl>
{{ end }}
{{ end }} <!-- ends "with $author_obj"-->
{{ end }} <!-- ends the range within "with $webmentions_rcv.links" -->
{{ end }} <!-- ends "with $webmentions_rcv.links" -->
......
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