mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-09-24 20:18:18 +00:00
bug fixes search
This commit is contained in:
+1
-10
@@ -168,16 +168,7 @@ gulp.task('pub-delete', () => {
|
||||
|
||||
|
||||
gulp.task('build:search-index', (cb) => {
|
||||
const env = process.env;
|
||||
|
||||
env.ALGOLIA_APP_ID = '30NEY6C9UY';
|
||||
env.ALGOLIA_INDEX_NAME = isProduction ? 'prod_docs' : 'dev_docs';
|
||||
env.ALGOLIA_INDEX_FILE = 'public/algolia.json';
|
||||
|
||||
const opts = {
|
||||
stdio: 'inherit',
|
||||
env: env
|
||||
};
|
||||
const opts = {stdio: 'inherit'};
|
||||
return spawn(process.cwd()+'/scripts/build-algolia.js', opts).on('close', (/* code */) => {
|
||||
cb();
|
||||
});
|
||||
|
||||
@@ -7,8 +7,6 @@ const {
|
||||
const md5 = require('md5');
|
||||
const atomicalgolia = require("atomic-algolia");
|
||||
const fs = require('fs');
|
||||
const isProduction = process.env.NODE_ENV === 'production';
|
||||
const indexName = isProduction ? "prod_docs" : "dev_docs";
|
||||
const nue = [];
|
||||
const rawdata = fs.readFileSync('public/algolia.json');
|
||||
const nodes = JSON.parse(rawdata);
|
||||
@@ -84,7 +82,7 @@ const merged = [...nodes, ...nue];
|
||||
|
||||
// fs.writeFileSync('public/combined.algolia.json', JSON.stringify(merged));
|
||||
// process.exit(0);
|
||||
atomicalgolia(indexName, merged, (err, result) => {
|
||||
atomicalgolia(process.env.ALGOLIA_INDEX_NAME, merged, (err, result) => {
|
||||
if (err) throw err;
|
||||
console.log(result);
|
||||
process.exit(0);
|
||||
|
||||
Reference in New Issue
Block a user