Closed gnublet closed 1 year ago
Hi thanks for opening an issue.
Can you describe exactly where and in what context you are encountering an issue? Is it the generation of links in the pages, or the generation of the canonical URL in the head ie.
<link rel="canonical" href="[http://localhost:3000/hello-astro/](view-source:http://localhost:3000/hello-astro/)">
I have compared the results between yarn dev and yarn preview and they seem consistent, because I am generally generating a URL based on BASE_URL for example
const siteurl = new URL(import.meta.env.BASE_URL, Astro.url)
First I want to say thanks for the beautiful template!
Actually, never mind. I can't reproduce the issue locally either. So I guess I'll close this.
As in this Issue, there may be a discrepancy in dev and prod URLs which may cause Google indexing to think the site has redirect issues.
We may need to switch URLs to
new URL('./relative', Astro.url)
according to https://docs.astro.build/en/reference/configuration-reference/#buildformat , in order to be consistent but I could be wrong.Also, there seems to be some work going on with astrojs/sitemap https://github.com/withastro/astro/issues/5604 and https://github.com/withastro/astro/issues/5630 to fix this issue.