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

v3 - basic sitemap generation #580

Merged
merged 5 commits into from
Sep 9, 2024
Merged

v3 - basic sitemap generation #580

merged 5 commits into from
Sep 9, 2024

Conversation

mathiazom
Copy link
Contributor

@mathiazom mathiazom commented Sep 4, 2024

Further explanation is found here: #578

Automatic sitemap generation based on Sanity documents with a defined slug value. Sitemap is available to crawlers at /sitemap.xml and the full url is included in a generated robots.txt.

We are assuming that all documents containing the field slug should be included in the sitemap. If this assumption is wrong, the GROQ query can be adjusted to for example only include specific document types (like blog and page).

Added environment value NEXT_PUBLIC_URL for development and production, as this is required to provide fully qualitifed URLs in the sitemap.

image

Checklist

Please ensure that you’ve completed the following checkpoints before submitting your pull request:

  • Documentation: Relevant documentation has been added or updated (if applicable).
  • Testing: Have you tested your changes thoroughly?

Copy link

vercel bot commented Sep 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
variant-no ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 9, 2024 9:31am
variant-se-2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 9, 2024 9:31am

@christinaroise
Copy link
Contributor

do/should we cover images in sitemap for variant?
https://developers.google.com/search/docs/crawling-indexing/sitemaps/image-sitemaps

@mathiazom
Copy link
Contributor Author

mathiazom commented Sep 9, 2024

do/should we cover images in sitemap for variant?

Image support in the Next.js sitemap generator was recently added in a canary release (https://github.com/vercel/next.js/releases/tag/v15.0.0-canary.107). So unless it's a top priority we might want to wait for that to be available. We could test if our images are already available to search engines (e.g. not using JavaScript to load), which would reduce the need to include them in the sitemap.

@mathiazom
Copy link
Contributor Author

TODO: handle pages under subpaths (e.g. blog post at /blog/hello)

src/app/sitemap.ts Outdated Show resolved Hide resolved
@christinaroise
Copy link
Contributor

Image support in the Next.js sitemap generator was recently added in a canary release (https://github.com/vercel/next.js/releases/tag/v15.0.0-canary.107). So unless it's a top priority we might want to wait for that to be available. We could test if our images are already available to search engines (e.g. not using JavaScript to load), which would reduce the need to include them in the sitemap.

could also be that most of our images are for illustrations only, and that images for say news and costumer cases are more important. But yeah, I agree. Let's hold images until we've got more of the project defined.

@mathiazom
Copy link
Contributor Author

TODO: handle pages under subpaths (e.g. blog post at /blog/hello)

This should be solved when blog post routes are migrated to shared studio, see issue #592

@mathiazom mathiazom force-pushed the feat/v3-automatic-sitemap branch from 92873dd to 1c8e6aa Compare September 9, 2024 09:29
@mathiazom mathiazom merged commit f5d19c4 into v3 Sep 9, 2024
6 checks passed
@mathiazom mathiazom deleted the feat/v3-automatic-sitemap branch September 9, 2024 09:33
@mathiazom mathiazom mentioned this pull request Sep 10, 2024
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