File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed
Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export default function robots(): MetadataRoute.Robots {
88 disallow : [ ] ,
99 } ,
1010 sitemap : [
11- 'https://grapesjs.com/sitemap.xml' ,
11+ 'https://grapesjs.com/sitemap-index .xml' ,
1212 'https://app.grapesjs.com/sitemap.xml' ,
1313 ] ,
1414 } ;
Original file line number Diff line number Diff line change 1+ import { NextResponse } from 'next/server' ;
2+
3+ const SITE_URL = 'https://grapesjs.com' ;
4+
5+ export async function GET ( ) {
6+ const sitemapIndex = `<?xml version="1.0" encoding="UTF-8"?>
7+ <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
8+ <sitemap>
9+ <loc>${ SITE_URL } /sitemap.xml</loc>
10+ <lastmod>${ new Date ( ) . toISOString ( ) . split ( 'T' ) [ 0 ] } </lastmod>
11+ </sitemap>
12+ <sitemap>
13+ <loc>${ SITE_URL } /docs/sitemap.xml</loc>
14+ <lastmod>${ new Date ( ) . toISOString ( ) . split ( 'T' ) [ 0 ] } </lastmod>
15+ </sitemap>
16+ </sitemapindex>` ;
17+
18+ return new NextResponse ( sitemapIndex , {
19+ status : 200 ,
20+ headers : {
21+ 'Content-Type' : 'application/xml' ,
22+ } ,
23+ } ) ;
24+ }
25+
You can’t perform that action at this time.
0 commit comments