Skip to content

Add sitemap and robots.txt to website-next#9675

Open
tobias-tengler wants to merge 1 commit into
mainfrom
tte/website-next-seo
Open

Add sitemap and robots.txt to website-next#9675
tobias-tengler wants to merge 1 commit into
mainfrom
tte/website-next-seo

Conversation

@tobias-tengler
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings May 11, 2026 16:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds SEO infrastructure to website-next by introducing a canonical site URL helper, generating sitemap.xml and robots.txt via Next.js Metadata routes, and defining default site-wide metadata (OpenGraph/Twitter/etc.) in the root layout.

Changes:

  • Introduce SITE_URL helper (overrideable via NEXT_PUBLIC_SITE_URL) for consistent absolute URL generation.
  • Add app/sitemap.ts to emit a static sitemap covering (content) pages, docs markdown, and blog posts.
  • Add app/robots.ts plus default metadata in app/layout.tsx to improve crawlability and social previews.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
website-next/src/helpers/siteUrl.ts Adds a canonical base URL constant used by metadata + sitemap/robots generation.
website-next/app/sitemap.ts Generates a static sitemap by walking content + docs + blog sources.
website-next/app/robots.ts Generates static robots.txt pointing at the sitemap and host.
website-next/app/layout.tsx Adds default Next.js metadata (metadataBase/OpenGraph/Twitter) using SITE_URL.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

allow: "/",
},
sitemap: `${SITE_URL}/sitemap.xml`,
host: SITE_URL,
Comment on lines +34 to +38
.map(({ file, urlPath }) => ({
url: `${SITE_URL}${urlPath}`,
lastModified: fs.statSync(file).mtime,
changeFrequency: "monthly",
priority: urlPath === "/" ? 1 : 0.7,
Comment on lines +55 to +60
.map(({ file, slug }) => ({
url: `${SITE_URL}/docs/${slug.join("/")}`,
lastModified: fs.statSync(file).mtime,
changeFrequency: "weekly",
priority: 0.5,
}));
Comment on lines +63 to +66
function blogPosts(): MetadataRoute.Sitemap {
return listBlogPosts().map(({ parsed, rel }) => ({
url: `${SITE_URL}${blogUrlForStem(parsed)}`,
lastModified: fs.statSync(path.join(BLOG_ROOT, rel)).mtime,
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