Closed 684efs3 closed 4 months ago
I am using remix-flat-routes with Remix+Vite as well as nasa-gcn/remix-seo.
The generated sitemap has extra slashes after the domain name, e.g. https://abc.com//xyz.
https://abc.com//xyz
My routes folder looks something like this:
routes
routes _auth+ login.jsx profile.jsx _marketing+ privacy.mdx terms.mdx _blog+ hello route.jsx test.mdx
Only /login and /profile are correctly generated in the sitemap. The other ones will have an extra slash.
My vite.config.ts looks like this:
vite.config.ts
remix({ ignoredRouteFiles: ['**/*'], routes: async defineRoutes => { return flatRoutes('routes', defineRoutes) } }),
My sitemap[.]xml.js looks like this:
sitemap[.]xml.js
import { generateSitemap } from '@nasa-gcn/remix-seo' import { siteConfig } from '../../utils/site-config' export async function loader ({ request }) { //@ts-ignore - This may fail during docker build typecheck if the app isn't build yet let build = await (import.meta.env.DEV ? import('../../build/server/index.js') : import( /* @vite-ignore */ import.meta.resolve('../../build/server/index.js') )) return generateSitemap(request, build.routes, { siteUrl: siteConfig.url, headers: { 'Cache-Control': `public, max-age=${60 * 5}` } }) }
@github.com/nasa-gcn/remix-seo/issues/7
See https://github.com/nasa-gcn/remix-seo/issues/8.
Sorry for not seeing this sooner. I'll take a look.
I believe this is an issue with remix-seo.
remix-seo
https://github.com/nasa-gcn/remix-seo/issues/7#issuecomment-1954329696
I am using remix-flat-routes with Remix+Vite as well as nasa-gcn/remix-seo.
The generated sitemap has extra slashes after the domain name, e.g.
https://abc.com//xyz
.My
routes
folder looks something like this:Only /login and /profile are correctly generated in the sitemap. The other ones will have an extra slash.
My
vite.config.ts
looks like this:My
sitemap[.]xml.js
looks like this:@github.com/nasa-gcn/remix-seo/issues/7