Releases: fedeya/remix-sitemap
Releases · fedeya/remix-sitemap
v2.2.1
v2.2.0
v2.1.0
v2.0.1
v2.0.0
What's Changed
Now the API is more flexible and easier to use.
Reference: remix-run/remix#2912 (comment)
Example for change properties in a route
import type { SitemapFunction } from 'remix-sitemap'
export const sitemap: SitemapFunction = () => ({
loc: '/about',
lastmod: new Date().toISOString(),
changefreq: 'daily',
priority: 0.5,
});
Example for usage in dynamic routes
import type { SitemapFunction } from 'remix-sitemap'
export const sitemap: SitemapFunction = async () => {
const posts = await getPosts();
return posts.map(post => ({
loc: `/posts/${post.slug}`,
exclude: post.isDraft,
}));
}
This new api not has support for optionalSegments
.
The most real use case it had was to be able to map the different routes located (like ($lang)/blog
), but it did not cover it 100% and its API was somewhat complicated.
I'm working on a new way to support internationalized routing and thinking again about the optionalSegments
api.
This discussion is open to suggestions and ideas. #29
Migration from v1 to v2
Both API's can be used at the same time for a incremental migration.
You can still use the old api, but it is deprecated and will be removed in the next major version.
Breaking Changes
- Marked
handle
as deprecated in #25
New Features
Documentation Changes
- Removed documentation for
optionalSegments
andhandle
- Moved the old docs to
docs/legacy
and updated the README.md to point to the new docs.
Full Changelog: v1.3.4...v2.0.0