sitemap-index.js 472 B

1234567891011121314
  1. import { SitemapBuilder } from '../builders/sitemap-builder.js';
  2. import { withXMLResponse } from './response.js';
  3. /**
  4. * Generate index sitemaps on server side
  5. * @param ctx
  6. * @param sitemaps
  7. * @returns
  8. */
  9. export const getServerSideSitemapIndex = async (ctx, sitemaps) => {
  10. // Generate index sitemap xml content
  11. const indexContents = new SitemapBuilder().buildSitemapIndexXml(sitemaps);
  12. // Return response
  13. return withXMLResponse(ctx, indexContents);
  14. };