astro-indexnow 0.0.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 +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/setup.d.ts +2 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +21 -0
- package/package.json +29 -0
package/README.md
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAE9C,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC9B,OAAO,EAAE,eAAe,GACvB,gBAAgB,CAoBlB"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default function indexNow(options) {
|
|
2
|
+
return {
|
|
3
|
+
name: "astro-indexnow",
|
|
4
|
+
hooks: {
|
|
5
|
+
"astro:build:done": async () => {
|
|
6
|
+
if (options?.enabled === false) {
|
|
7
|
+
console.log("[astro-indexnow] disabled");
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
if (!options?.key) {
|
|
11
|
+
throw new Error("[astro-indexnow] Missing IndexNow key. Run `npx astro add astro-indexnow`.");
|
|
12
|
+
}
|
|
13
|
+
console.log("[astro-indexnow] build completed");
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
}
|
package/dist/setup.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA,wBAA8B,KAAK,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE,GAAG,iBAuBlE"}
|
package/dist/setup.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export default async function setup({ addIntegration, prompt }) {
|
|
2
|
+
const key = await prompt({
|
|
3
|
+
name: "key",
|
|
4
|
+
type: "text",
|
|
5
|
+
message: "Enter your IndexNow API key:",
|
|
6
|
+
validate: (value) => value ? true : "IndexNow key is required",
|
|
7
|
+
});
|
|
8
|
+
const siteUrl = await prompt({
|
|
9
|
+
name: "siteUrl",
|
|
10
|
+
type: "text",
|
|
11
|
+
message: "Site URL (e.g. https://example.com):",
|
|
12
|
+
});
|
|
13
|
+
addIntegration({
|
|
14
|
+
name: "astro-indexnow",
|
|
15
|
+
import: "astro-indexnow",
|
|
16
|
+
options: {
|
|
17
|
+
key,
|
|
18
|
+
siteUrl: siteUrl || undefined,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "astro-indexnow",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Astro integration to submit changed pages to IndexNow automatically",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./dist/index.js",
|
|
8
|
+
"./setup": "./dist/setup.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsc",
|
|
15
|
+
"prepublishOnly": "npm run build"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"astro",
|
|
19
|
+
"astro-integration",
|
|
20
|
+
"indexnow",
|
|
21
|
+
"seo"
|
|
22
|
+
],
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"astro": "^4.0.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"typescript": "^5.0.0"
|
|
28
|
+
}
|
|
29
|
+
}
|