mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-23 03:29:11 +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
|
@ -34,7 +34,7 @@ function DocLegacyItem(props) {
|
|||
const {siteConfig = {}} = useDocusaurusContext();
|
||||
const {url: siteUrl} = siteConfig;
|
||||
const {metadata, content: DocContent} = props;
|
||||
const {description, title, permalink, image: metaImage} = metadata;
|
||||
const {description, title, permalink, image: metaImage, editUrl} = metadata;
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
@ -74,7 +74,23 @@ function DocLegacyItem(props) {
|
|||
<DocContent />
|
||||
</div>
|
||||
</article>
|
||||
<div className="margin-top--xl margin-bottom--lg">
|
||||
{editUrl && (
|
||||
<div className="margin-vert--xl">
|
||||
<div className="row">
|
||||
<div className="col">
|
||||
{editUrl && (
|
||||
<a
|
||||
href={editUrl}
|
||||
target="_blank"
|
||||
rel="noreferrer noopener">
|
||||
Edit this page
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<div className="margin-vert--lg">
|
||||
<DocLegacyPaginator metadata={metadata} />
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue