sitemap-ts-advanced
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

sitemap-ts

NPM Version Monthly Downloads Types Licence CI

Sitemap generator.

This plugin scans your dist folder to generate sitemap.xml and robots.txt files.

Configuration options

hostname

  • Type: string
  • Default: 'http://localhost/'

Base URI.

pathPrefix

  • Type: string
  • Default: 'docs'

Specify a path prefix to be added to all paths.

dynamicRoutes

  • Type: string[]
  • Default: []

Array of strings with manual routes.

const names = [
  'John',
  'Bryce',
  'Addison',
  'Dana',
]
const dynamicRoutes = names.map(name => `/names/${name}`)
Sitemap({ dynamicRoutes })

exclude

  • Type: string[]
  • Default: []

Array of strings with excluded routes.

generateSitemap({
  exclude: ['/admin', '/private']
})

outDir

  • Type: string
  • Default: 'dist'

Output/Scan directory.

changefreq

  • Type: string | (route: string) => string
  • Default: 'daily'

Change frequency option for sitemap.

priority

  • Type: number | (route: string) => number
  • Default: 1

Priority option for sitemap.

lastmod

  • Type: Date | (route: string) => Date
  • Default: new Date()

Last modification option for sitemap.

readable

  • Type: boolean
  • Default: false

Converts XML into a human readable format

robots

  • Type: RobotOption[]
  • Default: [{ userAgent: '*', allow: '/' }]

RobotOption:

  • userAgent: string
  • allow?: string | string[]
  • disallow?: string | string[]
  • crawlDelay?: number
  • cleanParam?: string

License

MIT License © 2022 JB Aubrée

Package Sidebar

Install

npm i sitemap-ts-advanced

Weekly Downloads

1

Version

0.2.0

License

MIT

Unpacked Size

15.6 kB

Total Files

6

Last publish

Collaborators

  • manuelmeister