mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-09-25 12:38:05 +00:00
bugs
This commit is contained in:
+2
-19
@@ -31,13 +31,13 @@ gulp.task('dev', ['build-dev'], () => {
|
||||
});
|
||||
|
||||
gulp.task('build', (cb) => {
|
||||
runSequence('pub-delete', 'sass', 'build:vendor', 'build:app', 'fonts', 'img', 'hugo', 'build:search-index', () => {
|
||||
runSequence('pub-delete', 'sass', 'build:vendor', 'build:app', 'fonts', 'img', 'hugo', () => {
|
||||
cb();
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('build-staging', (cb) => {
|
||||
runSequence('pub-delete', 'sass', 'build:vendor', 'build:app', 'fonts', 'img', 'hugo-staging', 'build:search-index', () => {
|
||||
runSequence('pub-delete', 'sass', 'build:vendor', 'build:app', 'fonts', 'img', 'hugo-staging', () => {
|
||||
cb();
|
||||
});
|
||||
});
|
||||
@@ -165,20 +165,3 @@ gulp.task('cms-delete', () => {
|
||||
gulp.task('pub-delete', () => {
|
||||
return del(['public/**', '!public']);
|
||||
});
|
||||
|
||||
|
||||
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
|
||||
};
|
||||
return spawn(process.cwd()+'/scripts/build-algolia.js', opts).on('close', (/* code */) => {
|
||||
cb();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -7,7 +7,8 @@ const {
|
||||
const md5 = require('md5');
|
||||
const atomicalgolia = require("atomic-algolia");
|
||||
const fs = require('fs');
|
||||
const indexName = "dev_docs"
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user