rangefind-astro 0.3.0 → 0.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/package.json +2 -2
- package/src/index.js +9 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rangefind-astro",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Astro integration for Rangefind — builds a static search index at `astro build` time and ships a drop-in search component.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"url": "git+https://github.com/xjodoin/rangefind.git",
|
|
48
48
|
"directory": "packages/rangefind-astro"
|
|
49
49
|
},
|
|
50
|
-
"homepage": "https://
|
|
50
|
+
"homepage": "https://rangefind.dev/docs/plugins/",
|
|
51
51
|
"bugs": {
|
|
52
52
|
"url": "https://github.com/xjodoin/rangefind/issues"
|
|
53
53
|
}
|
package/src/index.js
CHANGED
|
@@ -31,6 +31,9 @@ function resolveUnderOut(outDir, subPath) {
|
|
|
31
31
|
* @param {string} [options.baseUrl="/"] URL prefix/origin for result URLs.
|
|
32
32
|
* @param {string} [options.outputDir="rangefind"] Index output dir, relative to the build output (or absolute).
|
|
33
33
|
* @param {string} [options.assetsDir="_rangefind"] Client-asset dir, relative to the build output (or absolute).
|
|
34
|
+
* @param {object} [options.config] Rangefind config overrides merged into the crawler's generated config.
|
|
35
|
+
* @param {Function|string} [options.enrich] Async function(docs) — or a path to an ES module default-exporting one —
|
|
36
|
+
* run on the crawled documents before indexing (embeddings, metadata, …).
|
|
34
37
|
* @returns {import("astro").AstroIntegration}
|
|
35
38
|
*/
|
|
36
39
|
export default function rangefindAstro(options = {}) {
|
|
@@ -38,7 +41,9 @@ export default function rangefindAstro(options = {}) {
|
|
|
38
41
|
enabled = true,
|
|
39
42
|
baseUrl = "/",
|
|
40
43
|
outputDir = "rangefind",
|
|
41
|
-
assetsDir = "_rangefind"
|
|
44
|
+
assetsDir = "_rangefind",
|
|
45
|
+
config = null,
|
|
46
|
+
enrich = null
|
|
42
47
|
} = options;
|
|
43
48
|
|
|
44
49
|
return {
|
|
@@ -67,7 +72,9 @@ export default function rangefindAstro(options = {}) {
|
|
|
67
72
|
root: outDir,
|
|
68
73
|
scanDir: outDir,
|
|
69
74
|
output: indexOut,
|
|
70
|
-
baseUrl
|
|
75
|
+
baseUrl,
|
|
76
|
+
config,
|
|
77
|
+
enrich
|
|
71
78
|
});
|
|
72
79
|
logger.info(
|
|
73
80
|
`indexed ${result.docs} doc(s) from ${result.files} file(s) -> ${indexOut}`
|