How we generate the sitemap for the website.
sitemap
for the website using Next.js’s built-in sitemap generation functionality (sitemap.ts
). The generation process scans different directories in the project and creates sitemap entries for various types of content:
apps/web/config.ts
:
content/blog
directory.mdx
extension from filenamescontent/docs
directory.mdx
extension from filenamescontent/legal
directory.mdx
extensionsgetSitemapConfig
objectblog/
pathdocs/
pathlegal/
pathlastModified
timestamp (set to the current date)VERCEL_PROJECT_PRODUCTION_URL
environment variable, which will affect the domain of all URL in the sitemap. If your website is deployed on vercel, this variable will be automatically set to the domain name deployed by the project, and you can also manually set it to specify your domain name.For web
application, it could be set like your-domain.com
, The value does not include the protocol scheme https://.https://your-domain.com/sitemap.xml