feat(v2): add search page (#2756)

This commit is contained in:
Alexey Pyltsyn 2020-05-17 10:55:40 +03:00 committed by GitHub
parent 1fe2dc192e
commit 3ad4550854
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 688 additions and 38 deletions

View file

@ -46,6 +46,7 @@ import {
} from './types';
import {Configuration} from 'webpack';
import {docsVersion} from './version';
import {VERSIONS_JSON_FILE} from './constants';
const DEFAULT_OPTIONS: PluginOptions = {
path: 'docs', // Path to data on filesystem, relative to site dir.
@ -95,6 +96,10 @@ export default function pluginContentDocs(
return {
name: 'docusaurus-plugin-content-docs',
getThemePath() {
return path.resolve(__dirname, './theme');
},
extendCli(cli) {
cli
.command('docs:version')
@ -418,7 +423,16 @@ export default function pluginContentDocs(
configureWebpack(_config, isServer, utils) {
const {getBabelLoader, getCacheLoader} = utils;
const {rehypePlugins, remarkPlugins} = options;
// Suppress warnings about non-existing of versions file.
const stats = {
warningsFilter: [VERSIONS_JSON_FILE],
};
return {
stats,
devServer: {
stats,
},
resolve: {
alias: {
'~docs': dataDir,