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

Added addCanonical option #563

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Added addCanonical option #563

wants to merge 3 commits into from

Conversation

3xpo
Copy link

@3xpo 3xpo commented Jan 27, 2025

Added an addCanonical option, which is recommended when creating sitemaps in multiple language variations.
Example:

https://domain/it/terms-of-use
<xhtml:link rel="canonical" href="https://domain/it/terms-of-use" />
<xhtml:link rel="alternate" hreflang="en" href="https://domain/terms-of-use" />
<xhtml:link rel="alternate" hreflang="zh" href="https://domain/zh/terms-of-use" />
<xhtml:link rel="alternate" hreflang="hi" href="https://domain/hi/terms-of-use" />

Copy link
Member

@freekmurze freekmurze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a test for this and update the readme with a good example on how to use the new functionality + why canonical is important?

@@ -1,10 +1,11 @@
{
"name": "spatie/laravel-sitemap",
"description": "Create and generate sitemaps with ease",
"name": "3xpo/laravel-sitemap",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

composer.json should not be changed

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

Successfully merging this pull request may close these issues.

2 participants