mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-22 17:47:16 +00:00
Add a script to create an index for Algolia
This commit is contained in:
parent
78878a0e00
commit
80d8ff99ea
2 changed files with 11 additions and 1 deletions
|
|
@ -19,7 +19,8 @@
|
|||
"build": "react-scripts build",
|
||||
"test": "react-scripts test --env=jsdom",
|
||||
"eject": "react-scripts eject",
|
||||
"build-index": "node ./scripts/findSkins.js"
|
||||
"build-index": "node ./scripts/findSkins.js",
|
||||
"create-search-index": "node ./scripts/createSearchIndex.js > index.json"
|
||||
},
|
||||
"prettier": {},
|
||||
"browserslist": [
|
||||
|
|
|
|||
9
scripts/createSearchIndex.js
Normal file
9
scripts/createSearchIndex.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
const skins = require("../src/skins.json");
|
||||
|
||||
const indexes = [];
|
||||
|
||||
Object.entries(skins).forEach(([hash, { fileName }]) => {
|
||||
indexes.push({ objectID: hash, fileName });
|
||||
});
|
||||
|
||||
console.log(JSON.stringify(indexes, null, 2));
|
||||
Loading…
Add table
Add a link
Reference in a new issue