getSitemap
An instance method that provides SEO information about the pages created within Makeswift. You can combine the results of getSitemap with SEO information for your hardcoded pages to create a sitemap.
This method was deprecated in v0.19.0 and
was removed in
v0.25.0.
Use the getPages method to create a
sitemap instead, see the documentation
here.
A sitemap is a structured list of pages that enables web crawlers to find the pages of a site.
Options
Number of sitemap entries to fetch.
Starting id cursor of the last sitemap entry fetched.
Only sitemap entries beginning with this pathname will be returned.
A valid locale string (ex. "en-US").
Return type
Examples
Using next-sitemap
The following example uses getSitemap with next-sitemap, a popular Next.js library for generating sitemaps.
Filtering by pathname
The following example uses the pathnamePrefix option to filter results to only include pages with a pathname beginning with /blog/.
Using pagination
The following example uses the limit and after field to paginate the results of getSitemap 10 entries at a time.
Localization
The following example uses the locale option to fetch the sitemap for a specific locale.
If a locale is using domain-based localization, passing the locale to getSitemap will return the sitemap for that particular domain.
For example, if in the site settings there is an es locale with a domain of foo.es, then passing es to getSitemap will return the sitemap for foo.es.