I’m just learning Zola and think I’m most of the way to a basic working blog, but I’m at my wits’ end over what ought to be a trivial shortcode for a simple HTML <details>
disclosure widget. This takes block content and a summary
argument. The summary will sometimes contain inline markdown, such as code
; the block content will sometimes contain images via the usual ![]()
syntax.
My details.md
template is just:
<details>
<summary>
{{summary}}
</summary>
{{body}}
</details>
and I call it as
{% details(summary="Why `cargo` is nice") %}
Some optional longwinded discussion of why Cargo is nice, plus a cat.

{% end %}
The markdown processor doesn’t seem to process markdown in the shortcode’s output unless it’s separated from the preceding HTML tag by a blank line. Without that, cargo
doesn’t get rendered as code in the final page. But as soon as it is separated, it gets wrapped in a <p>
by the caller’s processor, and <p>
isn’t legal content for the <summary>
element. The world doesn’t explode or anything, but validators complain.
I originally had this as an HTML shortcode template because I hadn’t read the docs closely enough, but this had the same problem. I had to get the summary argument as {{summary | markdown | safe}}
and still got it wrapped in a <p>
. Plus, in an HTML shortcode there doesn’t seem to be any way to get the unqualified co-located cat.jpg
image link in the block content rewritten as absolute, meaning it’ll break in a feed context.
I’m starting to have horrible suspicions about the viability of <details>
in a blog anyway, having no particular optimism that feed readers will handle it consistently, but still can’t help feeling that I’m missing something fundamental about the Zola/Markdown processing model here. Can anyone help?
Update: bypassing the shortcode and inlining everything into the content page doesn’t help either; the summary content isn’t processed:
<details>
<summary>Test `code` test</summary>
blah blah blah
</details>
So it’s looking like a Markdown/pulldown issue rather than a Zola/shortcode one. Sorry if this is now the wrong forum to be asking in, but any suggestions still much appreciated.