fix(v2): do not warn about duplicated title for pages (#4507)

This commit is contained in:
Armano 2021-03-24 12:31:26 +01:00 committed by GitHub
parent 839d9d70ba
commit 17a7ce6d0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 3 deletions

View file

@ -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) {