mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 08:37:25 +02:00
feat(v2): generalize usage of _ prefix convention to exclude content files/folders (#5173)
* create a swizzleWarning partial for shared text * Generalize usage of _ prefix convention to exclude content files/folders * add api doc * MDX loader should not expect metadata/frontmatter on MDX partial files
This commit is contained in:
parent
0851e0e5bf
commit
8bdb3da233
40 changed files with 249 additions and 80 deletions
|
@ -14,6 +14,7 @@ import {
|
|||
normalizeUrl,
|
||||
parseMarkdownString,
|
||||
posixPath,
|
||||
Globby,
|
||||
} from '@docusaurus/utils';
|
||||
import {LoadContext} from '@docusaurus/types';
|
||||
|
||||
|
@ -28,7 +29,6 @@ import {
|
|||
} from './types';
|
||||
import getSlug from './slug';
|
||||
import {CURRENT_VERSION_NAME} from './constants';
|
||||
import globby from 'globby';
|
||||
import {getDocsDirPaths} from './versions';
|
||||
import {stripPathNumberPrefixes} from './numberPrefix';
|
||||
import {validateDocFrontMatter} from './docFrontMatter';
|
||||
|
@ -92,11 +92,12 @@ export async function readVersionDocs(
|
|||
versionMetadata: VersionMetadata,
|
||||
options: Pick<
|
||||
PluginOptions,
|
||||
'include' | 'showLastUpdateAuthor' | 'showLastUpdateTime'
|
||||
'include' | 'exclude' | 'showLastUpdateAuthor' | 'showLastUpdateTime'
|
||||
>,
|
||||
): Promise<DocFile[]> {
|
||||
const sources = await globby(options.include, {
|
||||
const sources = await Globby(options.include, {
|
||||
cwd: versionMetadata.contentPath,
|
||||
ignore: options.exclude,
|
||||
});
|
||||
return Promise.all(
|
||||
sources.map((source) => readDocFile(versionMetadata, source, options)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue