Hello All,
Please, if you can review the below, I do believe there is a way to do this, but I seem to be at an impasse:
Taking a URL such as:
https://www.example.site/about-us/lookie-here-ma/
I would like to from each .Page get that pages specific portion of the above url.
(would object be the correct word? .Page object?)
Examples:
/
|-about-us-| ← folder
|-_index.html <— what renders as “about-us”
|-lookie-here-ma.html <— what renders as “lookie-here-ma”
How can I have .Page in all cases return the value of that pages specific portion of the URL?
Examples:
.Slug for About-us (_index.html) works just fine and renders as (/about-us/)
But, .Slug for lookie-here-ma.html renders to (/about-us/lookie-here-ma/) <— I just want “lookie-here-ma”
.File.BaseFileName for about-us (_index.html) renders as (_index.html) <— Bad - I want “about-us”
But, for lookie-here-ma.html works just fine and renders as (/lookie-here-ma/)
I could do a test i.e. “If you are not a .Section then do one, if you aren’t do another”, but it seems that their is just a standard Hugo way to do this, that I’m just not seeing… Or some intense symdiff work, but still, I’m sure there is something I’m just missing.
If anyone could guide me, I’d much appreciate.
Thank you All.