Extend img shortcode

This commit is contained in:
Yash Karandikar 2023-08-11 19:32:01 -05:00
parent f27c871349
commit 90a74dd3e1
2 changed files with 11 additions and 3 deletions

View file

@ -8,7 +8,9 @@ Discord updates can be annoying, especially if you're not on Windows or a Debian
Arch Linux, on the other hand, distributes Discord through its `community` repository. When an update rolls around, though, usually it takes a while for the package maintainer to push an update. For platforms like this, Discord shows a "helpful" message, leaving users to figure it out on their own.
{{ img(src="/imgs/2022-10-26_08-37.png", caption="Message shown when Discord needs to be updated") }}
{% img(src="/imgs/2022-10-26_08-37.png") %}
Message shown when Discord needs to be updated
{% end %}
Fortunately though, there's a solution.

View file

@ -1,4 +1,10 @@
<figure>
<img src="{{ src }}" alt="{{ caption }}">
<figcaption>{{ caption | markdown(inline=true) | safe }}</figcaption>
<img src="{{ src }}"
{% if alt %}
alt="{{ alt }}"
{% else %}
alt="{{ body | safe }}"
{% endif %}
>
<figcaption>{{ body | markdown(inline=true) | safe }}</figcaption>
</figure>