retiried with the one argument form with both $.Site.GetPage and site.GetPage
behaviour is consitent
the one argument version works
the two argument version does not work
WARN site home two args found: Page(/posts/post-1)
WARN site home one arg found: Page(/posts/post-1)
WARN site home two args not found: post-4
WARN site home one arg found: Page(/posts/post-4)
WARN $.Site home two args found: Page(/posts/post-1)
WARN $.Site home one arg found: Page(/posts/post-1)
WARN $.Site home two args not found: post-4
WARN $.Site home one arg found: Page(/posts/post-4)
pages created by Content Adapter do not work with the two argument form
For example:
git clone --single-branch -b hugo-forum-topic-50099 https://github.com/jmooring/hugo-testing hugo-forum-topic-50099
cd hugo-forum-topic-50099
hugo server
There may be some cases where the two argument form doesn’t behave as desired, but I have a difficult time getting excited about that. As discussed, the two argument form is no longer documented—don’t use it.
Second, you have definitely uncovered a bug related to the Site.GetPage method’s ability to “fuzzy find” a page:
But I’m not very excited about that one either. To me, if you want Hugo to get a page relative to the site, you should tell Hugo exactly which page to get.
thx for the analysis, I must admit I did not check all cases.
definitely it’s solved with don’t use it and removal from docs.
and agreed in full path makes most sense, and for the rare case one knows he has that name only once in the site - it would be better to use full path, to have an exact reference on the long run.