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

Feature add hreflang x-default tag to sitemap #162

Merged

Conversation

RomainGueffier
Copy link
Contributor

@RomainGueffier RomainGueffier commented Mar 9, 2024

What does it do?

Add an additional link tag with hreflang x-default to improve locale detection fallback.
Add in settings form a select to save user preferences with 3 options:

  • Disabled
  • Default language pathname
  • Other
    When last option is selected, an extra text input field shows up to put a custom url.
    Add translations for English and French
    Extend default Test collection to add slug field in order to have better use cases to try feature.

Why is it needed?

Improve SEO.

How to test it?

Run strapi with plugin installed. Open Sitemap plugin settings.

Outputs:

  1. Disabled
disabled (default)
  1. Default Locale
default-locale (bundles)
  1. Other
Other (custom)

Related issue(s)/PR(s)

Closes #161

Tasks:

  • add more translations ?
  • can't find how to update docs via yarn docs:generate mentioned in CONTRIBUTING.md.
  • improve labels and descriptions to help users understand what it does and SEO risks.

⚠️ yarn develop / yarn playground:develop did not update admin UI on save, whereas server was ok. Is it normal ? I needed to restart playground on each UI changes.

@RomainGueffier RomainGueffier changed the title Feature/161 hreflang x default tag Feature add hreflang x-default tag to sitemap Mar 9, 2024
Copy link
Member

@boazpoolman boazpoolman left a comment

Choose a reason for hiding this comment

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

Thanks for this PR @RomainGueffier.
Functionally it works perfect!

I just have a couple remarks on your code.
If you could implement those changes I'll get this merged and released asap :)

README.md Outdated Show resolved Hide resolved
admin/src/translations/fr.json Outdated Show resolved Hide resolved
admin/src/tabs/Settings/index.jsx Outdated Show resolved Hide resolved
server/services/core.js Outdated Show resolved Hide resolved
admin/src/tabs/Settings/index.jsx Outdated Show resolved Hide resolved
@boazpoolman
Copy link
Member

⚠️ yarn develop / yarn playground:develop did not update admin UI on save, whereas server was ok. Is it normal ? I needed to restart playground on each UI changes.

You can run yarn playground:develop --watch-admin to make sure the admin also updates on save.

can't find how to update docs via yarn docs:generate mentioned in CONTRIBUTING.md.

Sorry. Those yarn docs: commands are outdated and should be removed from the package.json

Copy link
Member

@boazpoolman boazpoolman left a comment

Choose a reason for hiding this comment

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

LGTM!

@boazpoolman boazpoolman merged commit 116aa77 into pluginpal:master Mar 13, 2024
4 checks passed
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.

Add an additional link tag with hreflang x-default to improve locale detection fallback
2 participants