remove 404 from search

This commit is contained in:
Cory LaViska
2022-08-30 16:59:24 -05:00
parent ce12020fca
commit 972d629883

View File

@@ -70,13 +70,18 @@ console.log('Generating search index for documentation');
this.field('m', { boost: 2 }); // members (props, methods, events, etc.)
this.field('c'); // content
files.map((file, index) => {
files.forEach((file, index) => {
const relativePath = path.relative('./docs', file).replace(/\\/g, '/');
const relativePathNoExtension = relativePath.split('.').slice(0, -1).join('.');
const url = relativePath.replace(/\.md$/, '');
const filename = path.basename(file);
// Ignore certain directories and files
if (relativePath.startsWith('assets/') || relativePath.startsWith('dist/') || filename === '_sidebar.md') {
if (
relativePath.startsWith('assets/') ||
relativePath.startsWith('dist/') ||
filename === '_sidebar.md' ||
filename === '404.md'
) {
return false;
}