Hi everyone,
I’m facing an issue with my Hugo site where a piece of code works perfectly in my local environment, but when I deploy it to production, it behaves differently.
The code in question is:
$.Site.GetPage $content.url
On my local environment, this code retrieves the correct page without any issues. However, in production, Hugo seems to be adding _index.md
to the URLs, causing the page lookup to fail, and I’m unable to retrieve the desired page.
For example:
- Local: The URL resolves correctly, and the page is found.
- Production: The URL is somehow altered to include
_index.md
, and the page is not found.
Has anyone encountered this issue before? Is there a known fix or a way to ensure that _index.md
is not included in the URL when calling GetPage
in production?
Any help or guidance would be greatly appreciated!
Thanks!