@onruntime/next-sitemap 0.9.0 → 0.9.2

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.
@@ -270,10 +270,11 @@ function normalizePath(pathname) {
270
270
  }
271
271
  function buildUrl(baseUrl, pathname, locale, defaultLocale) {
272
272
  const normalizedPath = normalizePath(pathname);
273
+ const pathSuffix = pathname === "/" ? "" : normalizedPath;
273
274
  if (!locale || locale === defaultLocale) {
274
- return `${baseUrl}${normalizedPath}`;
275
+ return `${baseUrl}${pathSuffix}`;
275
276
  }
276
- return `${baseUrl}/${locale}${normalizedPath}`;
277
+ return `${baseUrl}/${locale}${pathSuffix}`;
277
278
  }
278
279
  function generateSitemapXml(entries, options) {
279
280
  const { poweredBy = true } = options || {};
package/dist/app/index.js CHANGED
@@ -247,10 +247,11 @@ function normalizePath(pathname) {
247
247
  }
248
248
  function buildUrl(baseUrl, pathname, locale, defaultLocale) {
249
249
  const normalizedPath = normalizePath(pathname);
250
+ const pathSuffix = pathname === "/" ? "" : normalizedPath;
250
251
  if (!locale || locale === defaultLocale) {
251
- return `${baseUrl}${normalizedPath}`;
252
+ return `${baseUrl}${pathSuffix}`;
252
253
  }
253
- return `${baseUrl}/${locale}${normalizedPath}`;
254
+ return `${baseUrl}/${locale}${pathSuffix}`;
254
255
  }
255
256
  function generateSitemapXml(entries, options) {
256
257
  const { poweredBy = true } = options || {};
package/dist/index.cjs CHANGED
@@ -270,10 +270,11 @@ function normalizePath(pathname) {
270
270
  }
271
271
  function buildUrl(baseUrl, pathname, locale, defaultLocale) {
272
272
  const normalizedPath = normalizePath(pathname);
273
+ const pathSuffix = pathname === "/" ? "" : normalizedPath;
273
274
  if (!locale || locale === defaultLocale) {
274
- return `${baseUrl}${normalizedPath}`;
275
+ return `${baseUrl}${pathSuffix}`;
275
276
  }
276
- return `${baseUrl}/${locale}${normalizedPath}`;
277
+ return `${baseUrl}/${locale}${pathSuffix}`;
277
278
  }
278
279
  function generateSitemapXml(entries, options) {
279
280
  const { poweredBy = true } = options || {};
package/dist/index.js CHANGED
@@ -247,10 +247,11 @@ function normalizePath(pathname) {
247
247
  }
248
248
  function buildUrl(baseUrl, pathname, locale, defaultLocale) {
249
249
  const normalizedPath = normalizePath(pathname);
250
+ const pathSuffix = pathname === "/" ? "" : normalizedPath;
250
251
  if (!locale || locale === defaultLocale) {
251
- return `${baseUrl}${normalizedPath}`;
252
+ return `${baseUrl}${pathSuffix}`;
252
253
  }
253
- return `${baseUrl}/${locale}${normalizedPath}`;
254
+ return `${baseUrl}/${locale}${pathSuffix}`;
254
255
  }
255
256
  function generateSitemapXml(entries, options) {
256
257
  const { poweredBy = true } = options || {};
@@ -270,10 +270,11 @@ function normalizePath(pathname) {
270
270
  }
271
271
  function buildUrl(baseUrl, pathname, locale, defaultLocale) {
272
272
  const normalizedPath = normalizePath(pathname);
273
+ const pathSuffix = pathname === "/" ? "" : normalizedPath;
273
274
  if (!locale || locale === defaultLocale) {
274
- return `${baseUrl}${normalizedPath}`;
275
+ return `${baseUrl}${pathSuffix}`;
275
276
  }
276
- return `${baseUrl}/${locale}${normalizedPath}`;
277
+ return `${baseUrl}/${locale}${pathSuffix}`;
277
278
  }
278
279
  function generateSitemapXml(entries, options) {
279
280
  const { poweredBy = true } = options || {};
@@ -247,10 +247,11 @@ function normalizePath(pathname) {
247
247
  }
248
248
  function buildUrl(baseUrl, pathname, locale, defaultLocale) {
249
249
  const normalizedPath = normalizePath(pathname);
250
+ const pathSuffix = pathname === "/" ? "" : normalizedPath;
250
251
  if (!locale || locale === defaultLocale) {
251
- return `${baseUrl}${normalizedPath}`;
252
+ return `${baseUrl}${pathSuffix}`;
252
253
  }
253
- return `${baseUrl}/${locale}${normalizedPath}`;
254
+ return `${baseUrl}/${locale}${pathSuffix}`;
254
255
  }
255
256
  function generateSitemapXml(entries, options) {
256
257
  const { poweredBy = true } = options || {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onruntime/next-sitemap",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "description": "Dynamic sitemap generation for Next.js with automatic route discovery",
5
5
  "author": "onRuntime Studio <contact@onruntime.com>",
6
6
  "repository": {