Hey Hugo community! Got a small thing I’m hitting a wall on and hoping to get some pointers on an alternative approach.
I’m having an issue with <meta> tags that reference an images on my website. Since the website is translated, it’s redirecting to the appropriate language directory (/en, /es, /ar) and the {{.Permalink}} for the image also includes the language (/en/image.png) which causes the images to not link properly.
For example, image url is /en/home/social.en.png and page is https://sitename.netlify.app/en/, which outputs a bad URL (https://sitename.netlify.app/en//en/home/social.en.png).
I’ve tried fixing this via absolute URLs on the meta image, but it always ends up as a relative URL once the site is built to production environment (even though they were absolute in local environment). Is there a way to fix this or another approach I’ve not considered?
Turns out the top level pages were redirecting to the Arabic versions because of a ‘url’ property that was pointing to the Arabic translation for those pages in the front matter. The issue was resolved by removing those properties.