mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-06 04:42:40 +02:00
fix(v2): do not warn about duplicated title for pages (#4507)
This commit is contained in:
parent
839d9d70ba
commit
17a7ce6d0d
3 changed files with 33 additions and 3 deletions
|
@ -276,9 +276,11 @@ export function readFrontMatter(
|
|||
const heading = /^# (.*)[\n\r]?/gi.exec(result.content);
|
||||
if (heading) {
|
||||
if (result.data.title) {
|
||||
console.warn(
|
||||
`Duplicate title detected in \`${source || 'this'}\` file`,
|
||||
);
|
||||
if (removeTitleHeading) {
|
||||
console.warn(
|
||||
`Duplicate title detected in \`${source || 'this'}\` file`,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
result.data.title = heading[1].trim();
|
||||
if (removeTitleHeading) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue