# Is it possible to customize code block with language title?

**URL:** <https://zola.discourse.group/t/is-it-possible-to-customize-code-block-with-language-title/728>\
**Category:** Uncategorized\
**Created:** [January 1, 2021, 4:26pm UTC](https://zola.discourse.group/t/is-it-possible-to-customize-code-block-with-language-title/728 "2021-01-01T16:26:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nahua](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/nahua/32/398_2.png) [@nahua](https://zola.discourse.group/u/nahua)\
**Post date:** [January 1, 2021, 4:26pm UTC](https://zola.discourse.group/t/is-it-possible-to-customize-code-block-with-language-title/728/1 "2021-01-01T16:26:26Z")

</div>

Hi all!

I just started using Zola today after being a bit frustrated with Hugo. I’m wondering if we could somehow customize the code block further, like giving it a title according to the language that is inside the `pre` tag? Like in the following image:

![code_block_title](https://global.discourse-cdn.com/free1/uploads/zola1/original/1X/d2c045a5519a0da44fd12242be76bee132bbf174.png)

In Hugo, I could retrive a `data-lang` attribute but it doesn’t seem to be available in the syntax highlighting mechanism for Zola.

Would appreciate some help 🙂 Thanks!

---

<div class="post-metadata">

**Author:** ![dertuxmalwieder](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/dertuxmalwieder/32/336_2.png) [@dertuxmalwieder](https://zola.discourse.group/u/dertuxmalwieder)\
**Post date:** [January 1, 2021, 8:58pm UTC](https://zola.discourse.group/t/is-it-possible-to-customize-code-block-with-language-title/728/2 "2021-01-01T20:58:30Z")

</div>

Not yet. I think it would have to be done in the theme.

---

<div class="post-metadata">

**Author:** ![nahua](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/nahua/32/398_2.png) [@nahua](https://zola.discourse.group/u/nahua)\
**Post date:** [January 1, 2021, 9:20pm UTC](https://zola.discourse.group/t/is-it-possible-to-customize-code-block-with-language-title/728/3 "2021-01-01T21:20:02Z")

</div>

I’m actually writing my own theme. Does this have to do with the “syntax engine” of Zola being different from Hugo’s?

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [January 2, 2021, 8:22am UTC](https://zola.discourse.group/t/is-it-possible-to-customize-code-block-with-language-title/728/4 "2021-01-02T08:22:56Z")

</div>

There will be a class with the language name in the next version ([https://github.com/getzola/zola/pull/1189/commits/6ef81940b89cf52c9c5f9074adaa88d57f2b00d0](https://github.com/getzola/zola/pull/1189/commits/6ef81940b89cf52c9c5f9074adaa88d57f2b00d0)) but adding something like data-lang makes sense as well. I’ll add that now.

Edit: [https://github.com/getzola/zola/pull/1189/commits/b9b4ef9f04c704dd94d41fad051ec3957a880c9c](https://github.com/getzola/zola/pull/1189/commits/b9b4ef9f04c704dd94d41fad051ec3957a880c9c)

0.13 should be released soonish, just waiting for a few dependencies to publish new versions on [crates.io](http://crates.io)

---

<div class="post-metadata">

**Author:** ![nahua](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/nahua/32/398_2.png) [@nahua](https://zola.discourse.group/u/nahua)\
**Post date:** [January 2, 2021, 9:42am UTC](https://zola.discourse.group/t/is-it-possible-to-customize-code-block-with-language-title/728/5 "2021-01-02T09:42:51Z")

</div>

Merci Vincent! And thanks for commenting on my Rust subreddit post 🙂

---

<div class="post-metadata">

**Author:** ![dertuxmalwieder](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/dertuxmalwieder/32/336_2.png) [@dertuxmalwieder](https://zola.discourse.group/u/dertuxmalwieder)\
**Post date:** [January 2, 2021, 9:53am UTC](https://zola.discourse.group/t/is-it-possible-to-customize-code-block-with-language-title/728/6 "2021-01-02T09:53:18Z")

</div>

> [@keats](#):
>
> adding something like data-lang makes sense as well

Isn’t the class unnecessary now?

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [January 2, 2021, 10:07am UTC](https://zola.discourse.group/t/is-it-possible-to-customize-code-block-with-language-title/728/7 "2021-01-02T10:07:48Z")

</div>

The class is for CSS styling (even though you can do it with `data` as well). It is a bit redundant but I think there’s no harm in having both.
