Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL in meta properties is not real but "example dot com" #49

Open
thamas opened this issue Jan 5, 2025 · 2 comments
Open

URL in meta properties is not real but "example dot com" #49

thamas opened this issue Jan 5, 2025 · 2 comments

Comments

@thamas
Copy link

thamas commented Jan 5, 2025

If I understand well this happens because no "site" is defined in the site configuration. (https://docs.astro.build/en/reference/configuration-reference/#site)

Defining a value as an example and/or mentioning it in the project's README would be nice.

Another option is to use Astro.url instead of Astro.site. Sg like this (in BaseHead.astro):

const resolvedImage = image?.src
  ? {
      src: new URL(image.src, Astro.url).toString(),
      alt: image.alt
    }
  : undefined;
const canonicalURL = Astro.url;
@thamas
Copy link
Author

thamas commented Jan 6, 2025

By the way, thanks for this theme! I'm using it here: https://thamas.hu/astro-hello/

@thamas
Copy link
Author

thamas commented Jan 7, 2025

Hm, maybe I was too tired to find https://github.com/JustGoodUI/dante-astro-theme/blob/2b06013e0a7c6bc155b5c1fcde96fd6450cfe8b0/astro.config.mjs#L8C5-L8C33 … Sorry!

Also, it turned out that the code change I suggest above works in dev mode but when the project is built Astro still uses the Astro.site value to set the URL in meta properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant