From b2df6aa7d2f267171ce1e7d001153a43a69bee95 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 26 Jun 2022 15:13:51 +0100 Subject: [PATCH] Refactor content details to use tags --- static/src/scss/_content.scss | 26 +++++------ static/src/scss/_hero.scss | 1 + static/src/scss/_listing.scss | 5 ++- .../templates/common/content-details.html | 45 ++++++++++++------- website/common/templates/common/hero.html | 5 +-- .../common/templates/common/listing-item.html | 2 +- 6 files changed, 45 insertions(+), 39 deletions(-) diff --git a/static/src/scss/_content.scss b/static/src/scss/_content.scss index e8de723..e279d58 100644 --- a/static/src/scss/_content.scss +++ b/static/src/scss/_content.scss @@ -4,26 +4,20 @@ section.content { } .content-details { - & > span + span { - margin-left: 0.5rem; + .tag { + font-size: inherit; } - i { - margin-right: 5px; - } + .control { + font-size: inherit; - .tags { - display: inline-flex; - margin-bottom: 0; + &:not(:last-child) { + margin-right: 0.5rem !important; + } - .tag { - background-color: unset; - font-size: inherit; - margin-bottom: 0; - padding: 0; - - & &:not(:last-child) { - margin-right: 0.2rem !important; + &.page-tags { + .tag:not(:first-child) { + padding-right: 0; } } } diff --git a/static/src/scss/_hero.scss b/static/src/scss/_hero.scss index 563af78..b6ade93 100644 --- a/static/src/scss/_hero.scss +++ b/static/src/scss/_hero.scss @@ -61,6 +61,7 @@ section.hero { } .content-details { + font-size: 90%; margin-bottom: 0.5rem; } } diff --git a/static/src/scss/_listing.scss b/static/src/scss/_listing.scss index f2f473e..d80b82b 100644 --- a/static/src/scss/_listing.scss +++ b/static/src/scss/_listing.scss @@ -20,8 +20,9 @@ max-height: 175px; } - .subtitle { - margin-bottom: 0.25rem !important; + .content-details { + font-size: 80%; + margin-top: $subtitle-negative-margin; } .media-content .content { diff --git a/website/common/templates/common/content-details.html b/website/common/templates/common/content-details.html index 0d75fef..0e056c4 100644 --- a/website/common/templates/common/content-details.html +++ b/website/common/templates/common/content-details.html @@ -1,20 +1,31 @@ -{% if page.date %} - {{ page.date|date:"Y-m-d" }} -{% endif %} +
-{% if page.reading_time %} - {{ page.reading_time }} minutes -{% endif %} - -{% spaceless %} - {% if page.tags.all %} - - -
- {% for tag in page.tags.all %} - #{{ tag.slug }} - {% endfor%} + {% if page.date %} +
+
+ + {{ page.date|date:"Y-m-d" }}
- +
{% endif %} -{% endspaceless %} + + {% if page.reading_time %} +
+
+ + {{ page.reading_time }} minutes +
+
+ {% endif %} + + {% if page.tags.all %} +
+
+ + {% for tag in page.tags.all %} + #{{ tag.slug }} + {% endfor %} +
+
+ {% endif %} +
diff --git a/website/common/templates/common/hero.html b/website/common/templates/common/hero.html index b3a0b86..3939674 100644 --- a/website/common/templates/common/hero.html +++ b/website/common/templates/common/hero.html @@ -14,9 +14,8 @@ {% if page.subtitle %}

{{ page.subtitle }}

{% endif %} -

- {% include "common/content-details.html" %} -

+ + {% include "common/content-details.html" %}