Closed brianmercer closed 4 years ago
This is nice idea.
Since I want to exclude "404. html", I would like to propose another method.
I thought it would be nice to add 「exclude」 to Options.
exclude:
type: array
required: false
default: []
example:
exclude:[
'/404.html',
'/hoge/'
]
const {
urls = [],
hostname,
cacheTime = 600,
xslUrl,
xmlNs,
outFile = 'sitemap.xml',
changefreq = 'daily',
+ exclude = [],
...others
} = options
Modify this part as follows
pagesMap.forEach((page, url) => {
- sitemap.add({ url, ...page })
+ if (!exclude.includes(url)) sitemap.add({ url, ...page })
})
@hi-kato hit a PR, please
Hey @ekoeryanto, would you please release a new version (to npm) for this new feature?
done
Please consider adding a method to exclude pages from the sitemap through a frontmatter tag. i.e.