commit f25e4d2ec8770bfa5c1b23c7b228d995f7a20356
parent 069a59202f97433ccd28d9af3ee30d3fd1b94781
Author: Robert Lützner <robert.luetzner@pm.me>
Date: Fri, 16 Feb 2024 18:59:36 +0000
Add missing p tag in aside shortcode definition (#18)
This fixes an issue where an `<aside>` element with a single line would
look really weird and boxed in, compared to an `<aside>` element with
multiple lines.
This has been bugging me for a while and I finally looked up how
Benjamin Hollon handles this on his blog. Here's a good example:
https://benjaminhollon.com/musings/wireless-is-a-lie/
. When compared with my own blog, I noticed the additional `<p>` tag in
Ben's code and everything became clear. If we have multiple lines, Hugo
will automatically introduce paragraphs and the formatting will be
correct. For a single line however, Hugo would assume that it was part
of the content surrounding it. That's why the surrounding box of an
`<aside>` element with a single line would look squashed.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/layouts/shortcodes/aside.html b/layouts/shortcodes/aside.html
@@ -1 +1 @@
-<aside>{{ .Inner | markdownify }}</aside>
+<aside><p>{{ .Inner | markdownify }}</p></aside>