vite-plugin-sitemap 0.5.3 → 0.6.1

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.
package/README.md CHANGED
@@ -38,11 +38,11 @@ export default {
38
38
  Now, run `npm build` and this will generate sitemap.xml and robots.txt files on your dist folder.
39
39
 
40
40
  ### To generate all pages of your app, you can:
41
+
41
42
  - Use dynamicRoutes to send routes paths.
42
43
  - Read [`MPA docs`](https://vitejs.dev/guide/build.html#multi-page-app) from Vite documentation.
43
44
  - Use MPA with [`vite-plugin-mpa`](https://github.com/IndexXuan/vite-plugin-mpa).
44
45
 
45
-
46
46
  ## Configuration options
47
47
 
48
48
  ### hostname
@@ -58,6 +58,7 @@ Base URI.
58
58
  - **Default:** `[]`
59
59
 
60
60
  Array of strings with manual dynamic routes.
61
+
61
62
  ```js
62
63
  const names = [
63
64
  'John',
@@ -83,6 +84,7 @@ You can find a working example in example folder.
83
84
  - **Default:** `[]`
84
85
 
85
86
  Array of strings with excluded routes.
87
+
86
88
  ```js
87
89
  export default {
88
90
  plugins: [
@@ -100,6 +102,7 @@ You can find a working example in example folder.
100
102
  - **Default:** `[]`
101
103
 
102
104
  Array of strings with other sitemaps paths or urls.
105
+
103
106
  ```js
104
107
  generateSitemap({
105
108
  externalSitemaps: ['sitemap_1', 'sitemap_2', 'subpath/sitemap_3', 'https://site.com/sitemap.xml']
@@ -156,6 +159,14 @@ The (optional) route `'*'` is used as default.
156
159
 
157
160
  Converts XML into a human readable format
158
161
 
162
+ ### i18n
163
+
164
+ - **Type:** `{ defaultLanguage?: string, languages: string[] }`
165
+ - **Default:** `undefined`
166
+
167
+ Add i18n support defining alternate links.
168
+ defaultLanguage will use this language with / and languages with /language
169
+
159
170
  ### generateRobotsTxt
160
171
 
161
172
  - **Type:** `boolean`
@@ -169,6 +180,7 @@ Enables robots.txt file generation
169
180
  - **Default:** `[{ userAgent: '*', allow: '/' }]`
170
181
 
171
182
  RobotOption:
183
+
172
184
  - **userAgent**: `string`
173
185
  - **allow**?: `string | string[]`
174
186
  - **disallow**?: `string | string[]`
package/dist/index.d.ts CHANGED
@@ -49,6 +49,18 @@ interface Options {
49
49
  * @default []
50
50
  */
51
51
  exclude: string[];
52
+ /**
53
+ * Array of i18n languages.
54
+ * Example: {
55
+ * defaultLanguage: 'fr'
56
+ * languages: ['fr', 'en', 'es']
57
+ * }
58
+ * @default undefined
59
+ */
60
+ i18n?: {
61
+ defaultLanguage?: string;
62
+ languages: string[];
63
+ };
52
64
  /**
53
65
  * Other sitemaps paths
54
66
  * Example: ['sitemap_1.xml', 'path/sitemap_2.xml', 'https://site.com/sitemap.xml']