I just discovered lately that, when writing Markdown, I can highlight Nunjucks code blocks using the twig
flag! At least it works with Dev.to Markdown flavor. I had previously tryed the nunjucks
tag without success and the html
was missing some key highlights. Here's a comparition of the three.
With the nunjucks
tag
---
permalink: formations/{{ video.snippet.title | lower | slug }}/
---
<section class="listing-section">
{% for video in videos %}
{% card
defaultClass = 'listing-card',
title = video.data.title,
detail = video.data.publishedat | timeFormat,
text = video.data.description,
link = video.url | url,
linkText = 'participe ร la formation!'
%}
{% endfor %}
</section>
With the html
tag
---
permalink: formations/{{ video.snippet.title | lower | slug }}/
---
<section class="listing-section">
{% for video in videos %}
{% card
defaultClass = 'listing-card',
title = video.data.title,
detail = video.data.publishedat | timeFormat,
text = video.data.description,
link = video.url | url,
linkText = 'participe ร la formation!'
%}
{% endfor %}
</section>
With the twig
tag
---
permalink: formations/{{ video.snippet.title | lower | slug }}/
---
<section class="listing-section">
{% for video in videos %}
{% card
defaultClass = 'listing-card',
title = video.data.title,
detail = video.data.publishedat | timeFormat,
text = video.data.description,
link = video.url | url,
linkText = 'participe ร la formation!'
%}
{% endfor %}
</section>
Ah, much better! Thanks for reading! ๐
Top comments (0)