create-sitecore-jss 22.5.0-canary.5 → 22.5.0-canary.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { NextApiRequest, NextApiResponse } from 'next';
|
|
2
|
-
import { NativeDataFetcher, GraphQLSitemapXmlService } from '@sitecore-jss/sitecore-jss-nextjs'
|
|
2
|
+
import { NativeDataFetcher, GraphQLSitemapXmlService } from '@sitecore-jss/sitecore-jss-nextjs'
|
|
3
3
|
import { siteResolver } from 'lib/site-resolver';
|
|
4
4
|
import config from 'temp/config';
|
|
5
5
|
import clientFactory from 'lib/graphql-client-factory';
|
|
@@ -24,11 +24,10 @@ const sitemapApi = async (
|
|
|
24
24
|
siteName: site.name,
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
//
|
|
28
|
-
// The id can be null if it's index sitemap.xml request
|
|
27
|
+
// if url has sitemap-{n}.xml type. The id - can be null if it's sitemap.xml request
|
|
29
28
|
const sitemapPath = await sitemapXmlService.getSitemap(id as string);
|
|
30
29
|
|
|
31
|
-
//
|
|
30
|
+
// if sitemap is match otherwise redirect to 404 page
|
|
32
31
|
if (sitemapPath) {
|
|
33
32
|
const isAbsoluteUrl = sitemapPath.match(ABSOLUTE_URL_REGEXP);
|
|
34
33
|
const sitemapUrl = isAbsoluteUrl ? sitemapPath : `${config.sitecoreApiHost}${sitemapPath}`;
|
|
@@ -44,7 +43,10 @@ const sitemapApi = async (
|
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
45
|
|
|
47
|
-
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
// this approache if user go to /sitemap.xml - under it generate xml page with list of sitemaps
|
|
48
50
|
const sitemaps = await sitemapXmlService.fetchSitemaps();
|
|
49
51
|
|
|
50
52
|
if (!sitemaps.length) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-sitecore-jss",
|
|
3
|
-
"version": "22.5.0-canary.
|
|
3
|
+
"version": "22.5.0-canary.6",
|
|
4
4
|
"description": "Sitecore JSS initializer",
|
|
5
5
|
"bin": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"ts-node": "^10.9.1",
|
|
66
66
|
"typescript": "~5.6.3"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "9ab8148977a555bd0a17a5606bf30feee155c294"
|
|
69
69
|
}
|