Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/capnfabs/paperesque.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Tamp <fabian.tamp@gmail.com>2020-03-31 18:46:29 +0300
committerFabian Tamp <fabian.tamp@gmail.com>2020-03-31 18:46:29 +0300
commit2d3dff057b272b59b1a01a6b704acbf5ea20c48d (patch)
treeefd39dcf720eb3bbb4951c039cfb6d6da3f10f2b
parent460ee2daa86648b6f3927e91e880d9ebe6c22049 (diff)
Support content warnings
-rw-r--r--layouts/shortcodes/cw.html5
-rw-r--r--static/css/style.css21
2 files changed, 26 insertions, 0 deletions
diff --git a/layouts/shortcodes/cw.html b/layouts/shortcodes/cw.html
new file mode 100644
index 0000000..abc3476
--- /dev/null
+++ b/layouts/shortcodes/cw.html
@@ -0,0 +1,5 @@
+<aside class="content-warning">
+ <p>
+ <strong>Content Note:</strong> {{ trim .Inner "\n" }}
+ </p>
+</aside>
diff --git a/static/css/style.css b/static/css/style.css
index 91ff94a..76e55d7 100644
--- a/static/css/style.css
+++ b/static/css/style.css
@@ -359,6 +359,27 @@ aside.article-aside {
margin-top: 3em;
}
+aside.article-aside > p:first-child {
+ margin-top: 1rem;
+}
+
+aside.content-warning {
+ font-style: italic;
+ margin-bottom: 2rem;
+ color: #777;
+ border-top: solid 1px #777;
+ border-bottom: solid 1px #777;
+ padding-left: 1em;
+ padding-right: 1em;
+ padding-top: 0.25em;
+ padding-bottom: 0.25em;
+ display: inline-block;
+}
+
+aside.content-warning > p:last-child {
+ margin-bottom: 0;
+}
+
/*
TODO: understand CSS so I don't need to do this insane thing. The idea here is
that if an `aside` appears immediately after a heading, it should have close