Skip to content

Commit

Permalink
Fixed relative links in generated docs
Browse files Browse the repository at this point in the history
Summary:Relative links did not have 'docs/' prefix, so all of them lead to 404 page.
Fixes facebook#5964
Closes facebook#5975

Differential Revision: D2943886

Pulled By: androidtrunkagent

fb-gh-sync-id: dbc2355ecf7ea4f1dea0f8f6a5ef50e5f324dfda
shipit-source-id: dbc2355ecf7ea4f1dea0f8f6a5ef50e5f324dfda
  • Loading branch information
bestander authored and facebook-github-bot-5 committed Feb 17, 2016
1 parent 1e8991a commit f73f417
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions website/layout/AutodocsLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ function renderType(type) {
if (type.name === 'custom') {
if (styleReferencePattern.test(type.raw)) {
var name = type.raw.substring(0, type.raw.indexOf('.'));
return <a href={slugify(name) + '.html#style'}>{name}#style</a>
return <a href={'docs/' + slugify(name) + '.html#style'}>{name}#style</a>
}
if (type.raw === 'ColorPropType') {
return <a href={'colors.html'}>color</a>
return <a href={'docs/colors.html'}>color</a>
}
if (type.raw === 'EdgeInsetsPropType') {
return '{top: number, left: number, bottom: number, right: number}';
Expand Down Expand Up @@ -140,7 +140,7 @@ var ComponentDoc = React.createClass({
return (
<div className="prop" key={name}>
<Header level={4} className="propTitle" toSlug={name}>
<a href={slugify(name) + '.html#props'}>{name} props...</a>
<a href={'docs/' + slugify(name) + '.html#props'}>{name} props...</a>
</Header>
</div>
);
Expand Down Expand Up @@ -506,8 +506,8 @@ var Autodocs = React.createClass({
{this.renderFullDescription(docs)}
{this.renderExample(docs, metadata)}
<div className="docs-prevnext">
{metadata.previous && <a className="docs-prev" href={metadata.previous + '.html#content'}>&larr; Prev</a>}
{metadata.next && <a className="docs-next" href={metadata.next + '.html#content'}>Next &rarr;</a>}
{metadata.previous && <a className="docs-prev" href={'docs/' + metadata.previous + '.html#content'}>&larr; Prev</a>}
{metadata.next && <a className="docs-next" href={'docs/' + metadata.next + '.html#content'}>Next &rarr;</a>}
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions website/layout/DocsLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ var DocsLayout = React.createClass({
/>
<Marked>{content}</Marked>
<div className="docs-prevnext">
{metadata.previous && <a className="docs-prev" href={metadata.previous + '.html#content'}>&larr; Prev</a>}
{metadata.next && <a className="docs-next" href={metadata.next + '.html#content'}>Next &rarr;</a>}
{metadata.previous && <a className="docs-prev" href={'docs/' + metadata.previous + '.html#content'}>&larr; Prev</a>}
{metadata.next && <a className="docs-next" href={'docs/' + metadata.next + '.html#content'}>Next &rarr;</a>}
</div>
</div>
</section>
Expand Down

0 comments on commit f73f417

Please sign in to comment.