# Add labels to code blocks?

**URL:** <https://zola.discourse.group/t/add-labels-to-code-blocks/2273>\
**Category:** Support\
**Created:** [September 2, 2024, 11:17pm UTC](https://zola.discourse.group/t/add-labels-to-code-blocks/2273 "2024-09-02T23:17:05Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![welpo](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/welpo/32/1087_2.png) [@welpo](https://zola.discourse.group/u/welpo)\
**Post date:** [September 6, 2024, 7:21pm UTC](https://zola.discourse.group/t/add-labels-to-code-blocks/2273/4 "2024-09-06T19:21:48Z")

</div>

> [@kaimast](#):
>
> Is there a built-in way to add a label/caption to them?

Here’s three ways:

1. Write the HTML manually ([Mozilla docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figure)).

2. See [this reply](https://zola.discourse.group/t/asset-colocation-within-shortcodes/120/2) for a simple shortcode to add figures with caption.

3. A quick search led me to [this shortcode](https://gist.github.com/asimpletune/a61b2ea07ece1e0fb563ea0aa9cfa37f) to insert a figure + citation within your markdown. I have not tested it.

---

_[View the full topic](https://zola.discourse.group/t/add-labels-to-code-blocks/2273)._
