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

Add sitemap.xml file #9173

Merged
merged 3 commits into from
Feb 20, 2024
Merged

Add sitemap.xml file #9173

merged 3 commits into from
Feb 20, 2024

Conversation

mjq-sentry
Copy link

@mjq-sentry mjq-sentry commented Feb 16, 2024

Generate a sitemap.xml during build time that is served statically at /sitemap.xml, and add a reference to it in robots.txt so that crawlers can find it. (See: https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap#addsitemap)

The sitemap only includes the required url property. It would be nice if we could add lastmod but the modified time on the source MDX files is not available during the production Vercel build as far as I can tell.

Fixes #9095.

Generate a sitemap.xml during build time that is served at `/sitemap.xml`, and
add a reference to it in `robots.txt` so that crawlers can find it.
(See: https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap#addsitemap)

The sitemap entries' `lastmod` property comes from the last modification time
of the source MDX files for each page. Note that this might not be completely
accurate, as updates to MDX fragments in `/includes` or `/platform-includes`
won't be considered.

Pages generated from our OpenAPI specs are missing `lastmod` properties since
we don't have a way to isolate the timestamp when individual pages change.
Copy link

vercel bot commented Feb 16, 2024

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

Name Status Preview Comments Updated (UTC)
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 20, 2024 8:52pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
sentry-docs-next ⬜️ Ignored (Inspect) Visit Preview Feb 20, 2024 8:52pm

Copy link
Contributor

@lizokm lizokm left a comment

Choose a reason for hiding this comment

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

LGTM!

@Jeffreyhung
Copy link
Member

Wow we have 5300+ pages for our doc site https://sentry-docs-git-mjq-sitemap.sentry.dev/sitemap.xml

@mjq-sentry mjq-sentry merged commit d46573a into master Feb 20, 2024
9 checks passed
@mjq-sentry mjq-sentry deleted the mjq-sitemap branch February 20, 2024 21:24
@github-actions github-actions bot locked and limited conversation to collaborators Mar 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add sitemap to docs build
4 participants