Current.Section from Shortcode

Hello!

I want to print the current folder name from a shortcode.

I have:

{{ .Page.CurrentSection }}

And I get:

Page(/about)

But I simply need:

about

I could do that before, when I had an _index.html in my /about section, but Hugo now tells me I need to have only one index. Before, I was okay using .Page.Section, but now it asks me to only have one index file

{{ .Page.CurrentSection.Path }} or similar. CurrentSection is a Page with plenty of attributes.

2 Likes

I need to buy you a beer sometime, man.

1 Like