mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 07:37:19 +02:00
feat(v2): add support to ignore files in pages plugin (#3196)
* add support to ignore pages
* fix import problem
* Update website/docs/guides/creating-pages.md
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
* Revert "fix import problem"
This reverts commit 4457a2e938
.
* revert
* fix slash
* forbid frontmatter
* fix formatting
* Update website/docs/guides/creating-pages.md
* Update website/src/pages/examples/_chapter1.md
* Update website/src/pages/examples/_chapter2.mdx
* Update website/src/pages/examples/markdownPageExample.md
* Update website/src/pages/examples/markdownPageExample.md
* Update website/src/pages/examples/markdownPageExample.md
* Update website/src/pages/examples/markdownPageExample.md
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
This commit is contained in:
parent
592fc48fd3
commit
f234c407f1
15 changed files with 82 additions and 7 deletions
|
@ -72,6 +72,17 @@ module.exports = async function (fileString) {
|
|||
}
|
||||
}
|
||||
|
||||
if (
|
||||
options.forbidFrontMatter &&
|
||||
typeof options.forbidFrontMatter === 'function'
|
||||
) {
|
||||
if (
|
||||
options.forbidFrontMatter(this.resourcePath) &&
|
||||
Object.keys(data).length > 0
|
||||
) {
|
||||
return callback(new Error(`Front matter is forbidden in this file`));
|
||||
}
|
||||
}
|
||||
const code = `
|
||||
import React from 'react';
|
||||
import { mdx } from '@mdx-js/react';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue