Skip to content

Instantly share code, notes, and snippets.

@mxro
Created March 10, 2021 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mxro/e1da628f4edc77248bf237e996b6c2fe to your computer and use it in GitHub Desktop.
Save mxro/e1da628f4edc77248bf237e996b6c2fe to your computer and use it in GitHub Desktop.
const { configureSitemap } = require('@sergeymyssak/nextjs-sitemap');
const Sitemap = configureSitemap({
baseUrl: 'https://example.com',
exclude: ['/admin'],
excludeIndex: true,
pagesConfig: {
'/about': {
priority: '0.5',
changefreq: 'daily',
},
},
isTrailingSlashRequired: true,
nextConfigPath: __dirname + '/next.config.js',
targetDirectory: __dirname + '/public',
pagesDirectory: __dirname + '/src/pages',
});
Sitemap.generateSitemap();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment