nextra icon indicating copy to clipboard operation
nextra copied to clipboard

Sitemap?

Open Suniron opened this issue 4 years ago • 4 comments

Hey there!

Is it possible to generate a sitemap for a Nextra based project?

Thanks! :-)

Suniron avatar Mar 17 '22 21:03 Suniron

@Suniron I was able to do so with adding the next-sitemap package and following the instructions in their docs. It was pretty simple and it generates a proper sitemap.

rgoomar avatar Apr 07 '22 00:04 rgoomar

Yes, sorry for this issue. In fact, it was really easy..

Suniron avatar Apr 07 '22 05:04 Suniron

Still an enhancement that Nextra can probably have. Maybe we can look into including next-sitemap by default :)

shuding avatar Apr 07 '22 17:04 shuding

Using nextra with next-sitemap and i18n generates sitemap for default language only. But it perfectly generates all language versions on build as expected. It seems that next-sitemap ignores all other language subfolders (in my case /es/) generated by nextra except the default locale.

const withNextra = require('nextra')({
  theme: 'nextra-theme-docs',
  themeConfig: './theme.config.js',
  unstable_staticImage: true
})
module.exports = withNextra({
  i18n: {
    locales: ['en', 'es'],
    defaultLocale: 'en',
    // localeDetection: false,
  }
})

alecpetrosky avatar Aug 19 '22 05:08 alecpetrosky

I don't see the future for this issue, next-sitemap should be executed after next build command and the physical next-sitemap config should be present.

The only way is by adding/configuring manually next-sitemap in your project.

dimaMachina avatar Oct 14 '22 02:10 dimaMachina