Allow edit URL to be customized with doc metadata (#443)

This commit is contained in:
Glavin Wiechert 2018-02-11 20:43:37 -04:00 committed by Joel Marcey
parent 5e39b2e01f
commit 41750667cd
2 changed files with 17 additions and 5 deletions

View file

@ -27,11 +27,11 @@ class Doc extends React.Component {
docSource = docSource.match(new RegExp(/version-.*\/(.*\.md)/, 'i'))[1];
}
let editLink = this.props.config.editUrl && (
<a
className="edit-page-link button"
href={this.props.config.editUrl + docSource}
target="_blank">
const editUrl =
this.props.metadata.custom_edit_url ||
(this.props.config.editUrl && this.props.config.editUrl + docSource);
let editLink = editUrl && (
<a className="edit-page-link button" href={editUrl} target="_blank">
{editThisDoc}
</a>
);