Hi there,
I’m now organising my content using the new Page Bundles.
I used to include a class in my element from the base filename e.g.
<article class="{{ .File.BaseFileName }}">
Which was handy for my css targeting because in the past I could apply styles to something like:
class=“contact”
Now I’m using bundles I get
class=“index”
For everything, which is expected because my leaf content is organised like:
content/contact/index.md
What I want is to recreate class="contact"
in the new Page bundle content organisation approach.
I tried:
<article class="{{ .RelPermalink }}">
But I get:
class="/contact/"
I tried:
<article class="{{ .Dir }}">
But I get:
class=“contact/”
Is there a simple variable I’m forgetting that will give me the result I’m after, or do I need to add some kind of filter to remove the slashes?
If it’s the latter, would love some advice on how to do that. I’m not a regex guru.
Thanks much!