Skip to content

Latest commit

 

History

History
52 lines (39 loc) · 960 Bytes

README.md

File metadata and controls

52 lines (39 loc) · 960 Bytes

react-sitemap-generator

"Buy Me A Coffee"

Get started

Install

npm install --save react-sitemap-generator

or

yarn add react-sitemap-generator

Usage

Minimum requirements example

import { generateSitemap } from 'react-sitemap-generator'
import Routes from './Routes'

generateSitemap({
  url: 'https://example.org',
  routes: [Routes],
})

Full example

import { generateSitemap } from 'react-sitemap-generator'
import Routes from './Routes'

generateSitemap({
  url: 'https://example.org',
  routes: [Routes],
  output: './public',
  options: {
    '/dashboard': { ignore: true }, // Remote path from sitemap
    '/video/:id': {
      slugs: { id: ['value1', 'value2'] }, // Creates multiple routes
      priority: 1,
      changefreq: 'never',
    },
  },
})