Thanks for sharing and updating the docs. I reverted to v0.92.1 which is the previous version I was using and the anchorize
behavior is the same.
This is a bit puzzling, as something else then seems to have changed since v0.92.1 to v0.94.2 (and v0.95) as my code is behaving differently.
This is the contents of a partial
that’s called in products/single
:
{{$product := replace .File.BaseFileName (anchorize .Title | urlize) ""}}
{{$product := strings.TrimRight "-" $product}}
{{$product := cond (in .File.BaseFileName (anchorize .Title | urlize)) $product (anchorize .Params.product | urlize)}}
{{$productProfile := .GetPage (printf "/products/%s" $product)}}
{{return $productProfile}}
With a {{.File.BaseFileName}}
like Nectar.com and {{.Title}}
like Apple & Honey, in v0.92.1 it would give:
nectar-com-
nectar-com
nectar-com
Page(/products/nectar-com.md)
It would produce the same results regardless of if the {{.Title}}
was Apple - Honey, Apple/Honey, Apple/ Honey, Apple / Honey or Apple + Honey.
Following the upgrade, I now get:
nectar-com-
nectar-com
nectarcom
nopPage
I get the same outcome with the following {{.Title}}
formats Apple - Honey, or Apple / Honey and Apple + Honey. It seems only Apple/ Honey renders the same outcome as before.
As the change seems to be linked to this statement:
{{$product := cond (in .File.BaseFileName (anchorize .Title | urlize)) $product (anchorize .Params.product | urlize)}}
I though anchorize
was the culprit, but that does not seem to be the case.
Any thoughts on what else may have changed that is causing my results to be different?