From 3b253dd697630dc3b5ffed1b0518a5bfa71ccf80 Mon Sep 17 00:00:00 2001 From: maia arson crimew Date: Thu, 18 May 2023 15:18:54 +0200 Subject: [PATCH] blog: add content warning system --- src/_includes/layouts/post.njk | 12 +++++++++++- src/posts/the-emails-2.md | 3 +++ src/posts/the-emails.md | 3 +++ src/static/style.css | 12 +++++++++++- 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/_includes/layouts/post.njk b/src/_includes/layouts/post.njk index 5f209f2..91bfffb 100644 --- a/src/_includes/layouts/post.njk +++ b/src/_includes/layouts/post.njk @@ -25,6 +25,16 @@ subhead: blog

{{ title }}

{{ description }} + {% if content_warnings %} +
+

+ content warnings:
+ {% for cw in content_warnings %} + {{ cw }}{% if not loop.last %}, {% endif %} + {% endfor %} +

+
+ {% endif %} {{ content | safe }} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/posts/the-emails-2.md b/src/posts/the-emails-2.md index e02b5cd..0645313 100644 --- a/src/posts/the-emails-2.md +++ b/src/posts/the-emails-2.md @@ -8,6 +8,9 @@ tags: - politics feature_image: /img/posts/the-emails-2/cover.jpg feature_alt: "a glitchy edited photo of a fax machine" +content_warnings: + - transphobia + - us politics --- **CLARIFICATION: i, maia, am not the source of this email leak, merely a publisher, since i feel that this should be more widely available than just to selected journalists** diff --git a/src/posts/the-emails.md b/src/posts/the-emails.md index 9c9c1a4..f134ef1 100644 --- a/src/posts/the-emails.md +++ b/src/posts/the-emails.md @@ -8,6 +8,9 @@ tags: - politics feature_image: /img/posts/the-emails/cover.jpg feature_alt: "a glitchy edited photo of a fax machine" +content_warnings: + - transphobia + - us politics --- **Emails.pdf (PDF, 2603 pages, 62MB), available as a [torrent](/files/emails.torrent) ([magnet](magnet:?xt=urn:btih:78cebcb51122170c857d71a6bd64e939c26af7f3&xt=urn:btmh:1220af77008cd1506d65208aa0a8cf8b288d783b90a7b4ea4f8c08fa3a5c08b90b5e))** diff --git a/src/static/style.css b/src/static/style.css index 8b51255..7485b2a 100644 --- a/src/static/style.css +++ b/src/static/style.css @@ -83,7 +83,7 @@ img { text-decoration: inherit; } -.kofi-banner { +.kofi-banner, .content-warnings { border-radius: 8px; padding: 4px; border: 2px solid rgb(255, 0, 140); @@ -91,6 +91,16 @@ img { font-size: 1.1rem; } +.content-warnings { + margin-top: 16px; + margin-bottom: 16px; + width: fit-content; +} + +.content-warnings > p { + margin: 0; +} + .greentext { color: #789922; }