Muut
February 7, 2016, 6:22pm
1
Is it possible to add own classes in h1–h6 and p tags with yaml? Example:
# This is main heading to be processed with magic
And I would like to have all h1 tags adapted with custom class “main-heading” -> output in html
<h1 class="main-heading">This is main heading to be processed with magic</h1>
Maybe something like this in yaml:
process:
content:
classes:
h1: main-heading
---
Muut
February 7, 2016, 6:54pm
2
in .md’s header
classes:
- h1: main-heading
- h2: secondary-heading
in your TWIG template:
<h1 class="{{ header.classes.h1 }} ">This is main heading to be processed with magic</h1>
<h2 class="{{ header.classes.h2 }} ">This is secondary heading to be processed with magic</h2>
---
Muut
February 7, 2016, 7:06pm
3
So, I can not use {{ content }} in TWIG template and get the classes automatically, if there is headings used?
Muut
February 7, 2016, 9:37pm
4
Muut
February 8, 2016, 7:06am
5
Yes, works nicely! Thanks.