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

Re-visit Sitemap Feature #4274

Open
SukkaW opened this issue Feb 25, 2025 · 3 comments
Open

Re-visit Sitemap Feature #4274

SukkaW opened this issue Feb 25, 2025 · 3 comments
Labels
enhancement New feature or request

Comments

@SukkaW
Copy link
Contributor

SukkaW commented Feb 25, 2025

Is your feature request related to a problem? Please describe.

Re-visit #419

Now with nextra 4, we have many methods like getPageMap, generateStaticParamsFor, and importPage, and it does make sense now to have a method that returns a sitemap.

Describe the solution you'd like

Next.js App Router has built-in sitemap support: https://nextjs.org/docs/app/api-reference/file-conventions/metadata/sitemap.

We can implement this in a way that users only need to create an app/sitemap.ts file with content similar to this:

export { getSiteMap as default } from 'nextra/page-map';

// sitemap.(js|ts) expects an default export that returns `Promise<import('next').MetadataRoute.Sitemap>`
@SukkaW SukkaW added the enhancement New feature or request label Feb 25, 2025
@dimaMachina
Copy link
Collaborator

I agree with it!

For now I still stay with next-sitemap, but while developing Nextra 4 I experimented with sitemap.ts file with fast-glob and
real last edit timestamp.

@SukkaW
Copy link
Contributor Author

SukkaW commented Feb 26, 2025

but while developing Nextra 4 I experimented with sitemap.ts file with fast-glob and
real last edit timestamp.

If nextra is already collecting page information, is it possible to create a sitemap from that data directly?

@dimaMachina
Copy link
Collaborator

yes, definitely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants