VitNode

Sitemap

Generate a sitemap.xml file automatically.

Thanks to NextJS Sitemap we can generate a sitemap.xml file automatically. This file is used by search engines to index your website.

For now VitNode will generate a sitemap.xml file for pages:

  • from navigation (inside header),
  • from /legal route

We're working on a way to add more pages in flexible way.

Extends sitemap

To extend the sitemap, you need to edit a sitemap.ts file.

apps/frontend/src/app/sitemap.ts
import type { MetadataRoute } from 'next';
 
import { CONFIG } from 'vitnode-frontend/helpers/config-with-env';
import { rootSitemap } from 'vitnode-frontend/sitemap';
 
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
  const sitemap = await rootSitemap();
 
  return sitemap; 

  return [

    ...sitemap,

    {

      url: `${CONFIG.frontend_url}/something`,

      lastModified: new Date(),

      changeFrequency: 'monthly',

      priority: 0.5,

    },

  ];
}

On this page