0.18.0 please read the upgrading guide.
This upgrade guide is only necessary if you’re using the
getPages Makeswift
client method. If you’re not using this method, you can safely skip this upgrade
guide.We also recommend following this guide if you’re using the getSitemap client
method, which has been deprecated in this release.Updating usage of getPages
In previous versions of the runtime, the Makeswift client provided a getPages
method to retrieve a list of all Makeswift page paths and their ids in the site.
In v0.19.0, the getPages method now has sorting, path filtering, and
pagination. This method was not previously paginated - in order to get all your
pages, you may now use our .toArray pagination helper method, which will
automatically paginate through all results and aggregate them into an array:
get-all-pages.ts
getPages now returns an instance of IterablePaginationResult, a decorated
async iterable which includes methods .map and .filter, in addition to
.toArray, mentioned above. The MakeswiftPage type has also been updated to
include several more data fields from the Makeswift page.
For more information about the usage of the getPages client method, please
refer to the getPages documentation.
Deprecation of getSitemap
v0.19.0 of the runtime also deprecates the getSitemap client method. While
getSitemap is still available in this version, it will be removed in a
future release. We recommend using the getPages method to construct your
sitemap instead.
Note that the deprecation of getSitemap now involves the host
being responsible for the construction of page URLs in the sitemap (either with
domain or path based localization).
Below is an example for pages router that uses path-based localization with the
next-sitemap library:
pages/sitemap.xml.ts
app/sitemap.ts