Support comment webmentions
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Yarmo Mackenbach 2020-06-25 10:04:52 +02:00
parent ee77a866a6
commit c6616ae9df
3 changed files with 70 additions and 11 deletions

View File

@ -282,6 +282,18 @@ table.music th:nth-child(3) {
font-style: normal;
font-size: 90%;
}
.comment {
padding: 12px;
margin: 32px 0 0;
background-color: var(--clr-bg-alt);
}
.comment .quote {
margin: 0 0 12px;
font-family: 'Lora', Georgia, Times, serif;
}
.comment .sub {
margin: 0;
}
.subsection {
margin: 64px 0 0;
border-top: 3px dashed rgba(0,0,0,0.5);

View File

@ -1,17 +1,30 @@
extends layout
mixin webmention($item)
p
if (array_key_exists('title', $item))
a(href="{$item['source']}") !{$item['title']}
else
a(href="{$item['source']}") !{$item['source']}
if (array_key_exists('author_name', $item))
| by !{$item['author_name']}
if (array_key_exists('date', $item))
| on !{$item['date']}
if (array_key_exists('time', $item))
| at !{$item['time']} UTC
if (!array_key_exists('type', $item))
p
if (array_key_exists('title', $item))
a(href="{$item['source']}") !{$item['title']}
else
a(href="{$item['source']}") !{$item['source']}
if (array_key_exists('author_name', $item))
| by !{$item['author_name']}
if (array_key_exists('date', $item))
| on !{$item['date']}
if (array_key_exists('time', $item))
| at !{$item['time']} UTC
else if ($item['type'] == "comment")
.comment
p.quote
| !{$item['title']}
p.sub
a(href="{$item['source']}") Commented
if (array_key_exists('author_name', $item))
| by !{$item['author_name']}
if (array_key_exists('date', $item))
| on !{$item['date']}
if (array_key_exists('time', $item))
| at !{$item['time']} UTC
mixin discussionLink($item)
p

View File

@ -1,5 +1,31 @@
extends layout
mixin webmention($item)
if (!array_key_exists('type', $item))
p
if (array_key_exists('title', $item))
a(href="{$item['source']}") !{$item['title']}
else
a(href="{$item['source']}") !{$item['source']}
if (array_key_exists('author_name', $item))
| by !{$item['author_name']}
if (array_key_exists('date', $item))
| on !{$item['date']}
if (array_key_exists('time', $item))
| at !{$item['time']} UTC
else if ($item['type'] == "comment")
.comment
p.quote
| !{$item['title']}
p.sub
a(href="{$item['source']}") Commented
if (array_key_exists('author_name', $item))
| by !{$item['author_name']}
if (array_key_exists('date', $item))
| on !{$item['date']}
if (array_key_exists('time', $item))
| at !{$item['time']} UTC
block content
header
nav
@ -21,3 +47,11 @@ block content
| :
br
| !{$reply['content']}
.webmentions.subsection
h2 Webmentions
if ($reply['hasWebmentions'])
each $item in $reply["webmentions"]
+webmention($item)
else
p This post has not been mentioned yet.