diff --git a/static/style.css b/static/style.css index 68dfd7f..b184b6e 100644 --- a/static/style.css +++ b/static/style.css @@ -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); diff --git a/views/post.pug b/views/post.pug index 5446a14..0349b65 100644 --- a/views/post.pug +++ b/views/post.pug @@ -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 diff --git a/views/reply.pug b/views/reply.pug index fddabed..5d11c93 100644 --- a/views/reply.pug +++ b/views/reply.pug @@ -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.