mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-28 16:37:07 +02:00
feat(v2): add editUrl option to docs plugin (#1818)
* feat(v2): add editUrl option to docs plugin * nits * misc(v2): nit * misc(v2): nit
This commit is contained in:
parent
aba9edc12c
commit
ae678c9dad
10 changed files with 66 additions and 6 deletions
|
@ -18,6 +18,7 @@ export default async function processMetadata(
|
|||
siteConfig: Partial<DocusaurusConfig>,
|
||||
docsBasePath: string,
|
||||
siteDir: string,
|
||||
editUrl?: string,
|
||||
): Promise<MetadataRaw> {
|
||||
const filepath = path.join(docsDir, source);
|
||||
|
||||
|
@ -82,5 +83,9 @@ export default async function processMetadata(
|
|||
}
|
||||
}
|
||||
|
||||
if (editUrl) {
|
||||
metadata.editUrl = normalizeUrl([editUrl, source]);
|
||||
}
|
||||
|
||||
return metadata as MetadataRaw;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue