sitemap-ts
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