サイトマップ

1/** @type {import('next-sitemap').IConfig} */
2
3module.exports = {
4  siteUrl: 'https://examples.flock.com',
5  generateRobotsTxt: true,
6};

解説

  1. プロジェクトルートに next-sitemap.config.js を作成(オプションはドキュメント参照)
  2. package.jsonscripts"postbuild": "next-sitemap" を追加。
  3. .gitignore に以下を追加
/public/sitemap* /public/robots.txt

使用ライブラリ

参考サイト