This is either a how-to or a support request
I was trying to get the subsection
string/slug of the following file structure:
posts/some-topic/subsection/_index.md
posts/some-topic/subsection/some-other-content.md
In both files I need to know the subsection
part of the structure. I thought .Section
is the way to go, but that and all other section related functions are focused on some-topic
.
After some deep diving I ended up with this construct:
((.CurrentSection).File).ContentBaseName
which returns subsection
in all cases as a string.
Is there some variable or method on a page object I am missing or is it really that complicated to get to the subsections slug?
Another way would probably be to use some regexp to extract the last string separated by /*/
. Both methods seem overkill.