diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-10-06 20:08:47 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-10-06 20:08:47 +0200 |
commit | 58ae96b7f6a5cd3b7c1fd1d650fcaae4686f578d (patch) | |
tree | c1555e51d2d399062d52a8b1df8eda1852a2bf7c /packages/gitbook-core/src/components | |
parent | 1354582c4e0d61c7608965f36b3c27ee3e39dc78 (diff) | |
download | gitbook-58ae96b7f6a5cd3b7c1fd1d650fcaae4686f578d.zip gitbook-58ae96b7f6a5cd3b7c1fd1d650fcaae4686f578d.tar.gz gitbook-58ae96b7f6a5cd3b7c1fd1d650fcaae4686f578d.tar.bz2 |
Add "url" to summary articles and files in json representation
Diffstat (limited to 'packages/gitbook-core/src/components')
-rw-r--r-- | packages/gitbook-core/src/components/Link.js | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/packages/gitbook-core/src/components/Link.js b/packages/gitbook-core/src/components/Link.js index f5b9753..145486e 100644 --- a/packages/gitbook-core/src/components/Link.js +++ b/packages/gitbook-core/src/components/Link.js @@ -19,19 +19,16 @@ const Link = React.createClass({ ]) }, - getHref() { - let { currentFile, to } = this.props; + render() { + const { currentFile, to, children, ...props } = this.props; + let href = to; if (SummaryArticle.is(to) || File.is(to)) { - to = to.url; + href = to.url; } - return currentFile.relative(to); - }, + href = currentFile.relative(href); - render() { - const { children, ...props } = this.props; - const href = this.getHref(); return <a href={href} {...props}>{children}</a>; } }); |