mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-20 10:08:17 +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
|
@ -6,7 +6,6 @@
|
|||
*/
|
||||
|
||||
import fs from 'fs-extra';
|
||||
import globby from 'globby';
|
||||
import chalk from 'chalk';
|
||||
import path from 'path';
|
||||
import readingTime from 'reading-time';
|
||||
|
@ -27,6 +26,7 @@ import {
|
|||
getFolderContainingFile,
|
||||
posixPath,
|
||||
replaceMarkdownLinks,
|
||||
Globby,
|
||||
} from '@docusaurus/utils';
|
||||
import {LoadContext} from '@docusaurus/types';
|
||||
import {validateBlogPostFrontMatter} from './blogFrontMatter';
|
||||
|
@ -127,6 +127,7 @@ export async function generateBlogPosts(
|
|||
): Promise<BlogPost[]> {
|
||||
const {
|
||||
include,
|
||||
exclude,
|
||||
routeBasePath,
|
||||
truncateMarker,
|
||||
showReadingTime,
|
||||
|
@ -138,8 +139,9 @@ export async function generateBlogPosts(
|
|||
}
|
||||
|
||||
const {baseUrl = ''} = siteConfig;
|
||||
const blogSourceFiles = await globby(include, {
|
||||
const blogSourceFiles = await Globby(include, {
|
||||
cwd: contentPaths.contentPath,
|
||||
ignore: exclude,
|
||||
});
|
||||
|
||||
const blogPosts: BlogPost[] = [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue