sitemap.js 400 B

12345678910111213
  1. import { withXMLResponse } from './response.js';
  2. import { SitemapBuilder } from '../builders/sitemap-builder.js';
  3. /**
  4. * Generate server side sitemaps
  5. * @param ctx
  6. * @param fields
  7. * @returns
  8. */
  9. export const getServerSideSitemap = async (ctx, fields) => {
  10. // Generate sitemap xml
  11. const contents = new SitemapBuilder().buildSitemapXml(fields);
  12. return withXMLResponse(ctx, contents);
  13. };