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

Trailing slash on schema @id despite trailingSlash: false #433

Open
Qewby opened this issue Jan 2, 2025 · 5 comments · May be fixed by #434
Open

Trailing slash on schema @id despite trailingSlash: false #433

Qewby opened this issue Jan 2, 2025 · 5 comments · May be fixed by #434
Labels
bug Something isn't working

Comments

@Qewby
Copy link

Qewby commented Jan 2, 2025

Environment

unhead 1.11.13
ufo 1.5.4
Node v20.15.0

Reproduction

Use parameter trailingSlash: false and function useSchemaOrg without custom node id.

Describe the bug

Function that create id for schema use withBase, that always add trailing slash, because it doesn't recognize fragments or query and join fragments using slash, so parameter trailingSlash doesn't work properly.

Additional context

No response

Logs

No response

@Qewby Qewby added the bug Something isn't working label Jan 2, 2025
@Qewby Qewby changed the title Fix trailing slash on all ids Trailing slash on schema @id despite trailingSlash: false Jan 2, 2025
@harlan-zw
Copy link
Collaborator

The node ids are just for a unique id of the node, the trailing slash in them will have no effect on the content of the nodes.

The format for the IDs comes from Yoast SEO, see here https://developer.yoast.com/features/schema/functional-specification/

@Qewby
Copy link
Author

Qewby commented Jan 3, 2025

I noticed that google try to crawl url from id. When canonical has no trailing slash, google can spend crawl budget for url with trailing slash.

@harlan-zw
Copy link
Collaborator

This is not something that is documented or I've ever seen. Can you provide some more details?

@Qewby
Copy link
Author

Qewby commented Jan 3, 2025

In Google Search Console for my site appear redirected page http://mysite.com/pathurl/ and this url is referenced by https://mysite.com/pathurl. But the only link that looks like this was in schema node id

@harlan-zw
Copy link
Collaborator

Unless you're seeing Google trying to access your URLs such as https://www.example.com/#/schema then I don't think this is related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants