mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-29 10:17:55 +02:00
Merge 353a12537b
into 67924ca979
This commit is contained in:
commit
d029b0c0b4
1 changed files with 6 additions and 1 deletions
|
@ -176,7 +176,12 @@ async function doProcessDocMetadata({
|
|||
// Note: the title is used by default for page title, sidebar label,
|
||||
// pagination buttons... frontMatter.title should be used in priority over
|
||||
// contentTitle (because it can contain markdown/JSX syntax)
|
||||
const title: string = frontMatter.title ?? contentTitle ?? baseID;
|
||||
// if filename is `index` or `readme`, then use the parent directory name
|
||||
const derivedNameFromPath = /^(?:index|readme)$/i.test(baseID)
|
||||
? path.basename(sourceDirName)
|
||||
: unprefixedFileName;
|
||||
const title: string =
|
||||
frontMatter.title ?? contentTitle ?? derivedNameFromPath;
|
||||
|
||||
const description: string = frontMatter.description ?? excerpt ?? '';
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue