astro-indexnow 2.2.0 โ 2.3.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 +24 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/package.json +1 -1
package/README.MD
CHANGED
|
@@ -6,8 +6,8 @@ to **IndexNow** after each build.
|
|
|
6
6
|
This package is designed for **modern CI/CD pipelines**, **Docker-based deployments**, and
|
|
7
7
|
**large static sites**, while remaining fully deterministic and explicit.
|
|
8
8
|
|
|
9
|
-
> **
|
|
10
|
-
> **Stateful by design.
|
|
9
|
+
> **Current release:** v2.3.1
|
|
10
|
+
> **Stateful by design. `changed` by default, `all` available. Batch-safe. CI-aware.**
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
@@ -27,6 +27,7 @@ Instead of waiting for crawlers, your site tells search engines exactly which UR
|
|
|
27
27
|
- ๐ **Detects changed pages automatically** using HTML hashing
|
|
28
28
|
- ๐ง Stores a small on-disk cache to avoid re-submitting unchanged URLs
|
|
29
29
|
- ๐ฆ **Batches submissions** safely (IndexNow 10,000 URL limit)
|
|
30
|
+
- ๐ Optional `submissionMode` lets you choose `changed` or `all`
|
|
30
31
|
- ๐งช Fully **CI/CD and Docker safe**
|
|
31
32
|
- ๐ No secrets prompted, stored, or mutated
|
|
32
33
|
- ๐งฉ No client-side or runtime code added
|
|
@@ -117,6 +118,9 @@ export default defineConfig({
|
|
|
117
118
|
|
|
118
119
|
Using environment variables is **strongly recommended** for CI/CD.
|
|
119
120
|
|
|
121
|
+
This release is backwards compatible with earlier supported package versions.
|
|
122
|
+
Older npm versions are not deprecated by default; they remain supported until a future major release introduces a breaking change.
|
|
123
|
+
|
|
120
124
|
---
|
|
121
125
|
|
|
122
126
|
## How It Works
|
|
@@ -228,6 +232,24 @@ Example: `./node_modules/.astro`
|
|
|
228
232
|
|
|
229
233
|
---
|
|
230
234
|
|
|
235
|
+
### `submissionMode` (optional)
|
|
236
|
+
|
|
237
|
+
Type: `"changed" | "all"`
|
|
238
|
+
Default: `"changed"`
|
|
239
|
+
|
|
240
|
+
Controls which URLs are submitted after a build:
|
|
241
|
+
|
|
242
|
+
- `changed` submits only new or modified pages
|
|
243
|
+
- `all` submits every generated page in the current build output
|
|
244
|
+
|
|
245
|
+
```js
|
|
246
|
+
indexnow({
|
|
247
|
+
submissionMode: "all",
|
|
248
|
+
})
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
231
253
|
## IndexNow Limits & Batching
|
|
232
254
|
|
|
233
255
|
- IndexNow allows **up to 10,000 URLs per request**
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAM9C,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAM9C,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;CACpC;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC9B,OAAO,GAAE,eAAoB,GAC5B,gBAAgB,CA8MlB"}
|
package/dist/index.js
CHANGED
|
@@ -116,13 +116,16 @@ export default function indexNow(options = {}) {
|
|
|
116
116
|
: "new/changed";
|
|
117
117
|
logger.debug(` - ${url} (${state})`);
|
|
118
118
|
}
|
|
119
|
-
|
|
119
|
+
const urlsToSubmit = options.submissionMode === "all"
|
|
120
|
+
? Object.keys(nextCache)
|
|
121
|
+
: changedUrls;
|
|
122
|
+
if (urlsToSubmit.length === 0) {
|
|
120
123
|
logger.info("[astro-indexnow] no changed URLs detected, skipping submission");
|
|
121
124
|
saveCache(logger, nextCache);
|
|
122
125
|
return;
|
|
123
126
|
}
|
|
124
|
-
const batches = chunk(
|
|
125
|
-
logger.info(`[astro-indexnow] submitting ${
|
|
127
|
+
const batches = chunk(urlsToSubmit, INDEXNOW_BATCH_SIZE);
|
|
128
|
+
logger.info(`[astro-indexnow] submitting ${urlsToSubmit.length} URL(s) in ${batches.length} batch(es) [mode=${options.submissionMode ?? "changed"}]`);
|
|
126
129
|
for (let i = 0; i < batches.length; i++) {
|
|
127
130
|
const batch = batches[i];
|
|
128
131
|
logger.debug(`[astro-indexnow] submitting batch ${i + 1}/${batches.length} (${batch.length} URLs)`);
|