diff --git a/README.md b/README.md index 7d4bd77f..bc38a1ed 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ Above is the minimal configuration to split a large sitemap. When the number of | siteUrl | Base url of your website | string | | changefreq (optional) | Change frequency. Default `daily` | string | | priority (optional) | Priority. Default `0.7` | number | -| sitemapBaseFileName (optional) | The name of the generated sitemap file before the file extension. Default `"sitemap"` | string | +| sitemapBaseFileName (optional) | The name of the generated sitemap file before the file extension. Default `"sitemap"` | string | | alternateRefs (optional) | Denote multi-language support by unique URL. Default `[]` | AlternateRef[] | | sitemapSize(optional) | Split large sitemap into multiple files by specifying sitemap size. Default `5000` | number | | generateRobotsTxt (optional) | Generate a `robots.txt` file and list the generated sitemaps. Default `false` | boolean | diff --git a/packages/next-sitemap/src/cli.ts b/packages/next-sitemap/src/cli.ts index 225cd88c..405c1c9d 100644 --- a/packages/next-sitemap/src/cli.ts +++ b/packages/next-sitemap/src/cli.ts @@ -36,7 +36,11 @@ import { exportRobotsTxt } from './robots-txt' // Split sitemap into multiple files const chunks = toChunks(urlSet, config.sitemapSize!) - const sitemapChunks = resolveSitemapChunks(runtimePaths.SITEMAP_FILE, chunks, config) + const sitemapChunks = resolveSitemapChunks( + runtimePaths.SITEMAP_FILE, + chunks, + config + ) // All sitemaps array to keep track of generated sitemap files. // Later to be added on robots.txt diff --git a/packages/next-sitemap/src/config/index.ts b/packages/next-sitemap/src/config/index.ts index 76bb8d60..2d05abb4 100644 --- a/packages/next-sitemap/src/config/index.ts +++ b/packages/next-sitemap/src/config/index.ts @@ -31,7 +31,7 @@ export const defaultConfig: Partial = { sourceDir: '.next', outDir: 'public', priority: 0.7, - sitemapBaseFileName: "sitemap", + sitemapBaseFileName: 'sitemap', changefreq: 'daily', sitemapSize: 5000, autoLastmod: true, diff --git a/packages/next-sitemap/src/interface.ts b/packages/next-sitemap/src/interface.ts index a65fb9bd..2df1cbf1 100644 --- a/packages/next-sitemap/src/interface.ts +++ b/packages/next-sitemap/src/interface.ts @@ -13,7 +13,7 @@ export interface IConfig { siteUrl: string changefreq: string priority: any - sitemapBaseFileName?: string; + sitemapBaseFileName?: string sourceDir?: string outDir?: string sitemapSize?: number diff --git a/packages/next-sitemap/src/path/index.ts b/packages/next-sitemap/src/path/index.ts index cd58aaf0..1014898d 100644 --- a/packages/next-sitemap/src/path/index.ts +++ b/packages/next-sitemap/src/path/index.ts @@ -21,7 +21,9 @@ export const resolveSitemapChunks = ( ): ISitemapChunk[] => { const folder = path.dirname(baseSitemapPath) return chunks.map((chunk, index) => { - const filename = `${config.sitemapBaseFileName}${index > 0 ? `-${index}` : ''}.xml` + const filename = `${config.sitemapBaseFileName}${ + index > 0 ? `-${index}` : '' + }.xml` return { path: `${folder}/${filename}`,