1
0
mirror of https://github.com/minio/docs.git synced 2025-04-24 06:05:11 +03:00
docs/gulpfile.js
Rushan 594a9cfb6e
Replace Algolia DocSearch with InstantSearch (#621)
- Rendered only the relevant search results that has the match-level of
either `full` or `partial`.
- Added refinements to display results from other platforms (Active
platform is selected by default).
- Better title and hierarchical display.

![title](https://user-images.githubusercontent.com/13393018/198229684-3018b591-a54c-4b4f-80db-94c11e33ec65.svg)


- Added icons to represent the hierarchy level.

![icons](https://user-images.githubusercontent.com/13393018/198228150-143153bf-aa9a-4c41-baf8-bd9fa3d33bf2.png)
- Relevant results on full/partial match queries.
<img width="595" alt="Screenshot 2022-10-27 at 12 09 26"
src="https://user-images.githubusercontent.com/13393018/198228440-3a7b52a6-9f33-4778-a2ab-15b1454ede99.png">

- TODO: Keyboard shortcut to trigger/focus the search modal. (Will
address this with a new PR)
2022-11-02 09:21:21 -05:00

72 lines
1.8 KiB
JavaScript

'use strict';
var gulp = require ('gulp');
var cleanCSS = require('gulp-clean-css');
var $ = require ('gulp-load-plugins') ();
var connect = require('gulp-connect');
var sass = require('gulp-sass')(require('sass'));
var branchDir = 'master';
var paths = {
scss: {
dir: 'source/_static/scss',
main: 'source/_static/scss/main.scss',
files: 'source/_static/scss/**/*.scss'
},
css: {
dir: 'source/_static/css',
main: 'source/_static/scss/main.css',
files: 'source/_static/scss/**/*.css',
dist: `build/${branchDir}/html/_static/css`
},
js: {
dir: 'source/_static/js',
main: 'source/_static/js/main.js',
files: 'source/_static/js/**/*.js',
dist: `build/${branchDir}/html/_static/js`,
},
dist: `build/${branchDir}/html`
}
// Compile SCSS
gulp.task('handleStyle', function() {
return gulp.src (paths.scss.main)
.pipe(sass ())
.pipe($.autoprefixer())
.pipe(gulp.dest (paths.css.dir))
.pipe(cleanCSS())
.pipe($.rename({
suffix: '.min'
}))
.pipe(gulp.dest (paths.css.dir))
.pipe(gulp.dest (paths.css.dist))
.pipe(connect.reload());
});
// Minify and move JS
gulp.task('handleJs', function() {
return gulp.src (paths.js.files)
.pipe($.terser())
.pipe(gulp.dest (paths.js.dist))
.pipe(connect.reload());
});
// Live server
gulp.task('connect', function() {
connect.server({
root: paths.dist,
livereload: true
});
});
// Watch
gulp.task('watch', function () {
gulp.watch(paths.scss.files, gulp.series('handleStyle'));
gulp.watch(paths.js.files, gulp.series('handleJs'));
});
// Build
gulp.task('default', gulp.series('handleStyle', 'handleJs'));