Closed fedeya closed 1 year ago
Also to change properties quickly is cleaner
Now
export const handle: SitemapHandle = {
sitemap: {
generateEntries: () => [{
loc: '/about',
priority: 0.2,
changefreq: 'weekly',
}]
}
}
New API
export const sitemap: SitemapFunction = () => ({
priority: 0.2,
changefreq: 'weekly'
});
this new api is in v2 branch, the discussion keeps open for feedback
Maybe can be improved the developer experience changing the api from sitemap property in
handle
to a sitemap function likemeta
orlinks
Reference: https://github.com/remix-run/remix/discussions/2912#discussioncomment-3048673
Example
This is very possible, for build time generation i get the all exported modules when i build each route with esbuild. And for runtime generation i can get it from the same route modules where i get the
handle
Also for settings like
exclude
oraddOptionalPaths
it can be more conditional.Example if you want to hide only one route in a collection