Handle external doc links

Reviewed By: danielbuechele

Differential Revision: D6976132

fbshipit-source-id: 56bd33816a312af12ba9a0f088c9f49a42ef9913
This commit is contained in:
Emil Sjölander
2018-02-13 06:37:47 -08:00
committed by Facebook Github Bot
parent 9b501dd9eb
commit 82e44dbf04

View File

@@ -49,9 +49,13 @@ export default ({data}) => (
node.fileAbsolutePath.indexOf(`/${category}/`) > -1,
)
.map(({node}) => (
<Link key={node.id} to={node.frontmatter.path}>
{node.frontmatter.title}
</Link>
node.frontmatter.path.startsWith('http')
? (<a key={node.id} href={node.frontmatter.path}>
{node.frontmatter.title}
</a>)
: (<Link key={node.id} to={node.frontmatter.path}>
{node.frontmatter.title}
</Link>)
))}
</Col>
),