From 41d4db8ecddcbcd6d50f277dd22b5f6c0a123747 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Thu, 18 Jun 2020 18:41:23 +0200 Subject: [PATCH] Add discussion subsection --- functions.php | 1 + static/style.css | 5 ++++- views/blog_post.pug | 12 +++++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index 6f41712..870663a 100644 --- a/functions.php +++ b/functions.php @@ -45,6 +45,7 @@ function getBlogPosts($params) { "slug" => $meta["slug"], "date" => $meta["date"], "published" => $meta["published"], + "discussion" => $meta["discussion"], "content" => $mp->text($content)); $date = new DateTime($post['date']); diff --git a/static/style.css b/static/style.css index 412accc..5f7d652 100644 --- a/static/style.css +++ b/static/style.css @@ -308,10 +308,13 @@ table.music th:nth-child(3) { font-style: normal; font-size: 90%; } -.webmentions { +.subsection { margin: 64px 0 0; border-top: 3px dashed rgba(0,0,0,0.5); } +.subsection h2 { + margin: 48px 0 0; +} /* Lists */ .list { diff --git a/views/blog_post.pug b/views/blog_post.pug index 76235e7..1de7bdb 100644 --- a/views/blog_post.pug +++ b/views/blog_post.pug @@ -5,6 +5,10 @@ mixin webmention($item) a(href="{$item['source']}") !{$item['title']} | by !{$item['author_name']} on !{$item['date']} at !{$item['time']} +mixin discussionLink($item) + p + a(href="{$item}") !{$item} + block content header nav @@ -24,8 +28,14 @@ block content .longform__content.e-content | !{$post['content']} + + if ($post['discussion']) + .discussion.subsection + h2 Join the discussion + each $item in $post["discussion"] + +discussionLink($item) - .webmentions + .webmentions.subsection h2 Webmentions if ($post['hasWebmentions']) each $item in $post["webmentions"]