UNPKG

remix-seo-plus

Version:

Collection of SEO utilities like sitemap, robots.txt, etc. for a Remix application. A fork of https://github.com/balavishnuvj/remix-seo with some added bug fixes and features.

18 lines (17 loc) 624 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.generateSitemap = void 0; const utils_1 = require("./utils"); async function generateSitemap(args, routes, options) { const { siteUrl, headers } = options; const sitemap = await (0, utils_1.getSitemapXml)(args, routes, { siteUrl }); const bytes = new TextEncoder().encode(sitemap).byteLength; return new Response(sitemap, { headers: { ...headers, "Content-Type": "application/xml", "Content-Length": String(bytes), }, }); } exports.generateSitemap = generateSitemap;