-
Notifications
You must be signed in to change notification settings - Fork 24.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ability to switch version in documentation website
Reviewed By: svcscm Differential Revision: D2932534 fb-gh-sync-id: e67f028c914b64424458dad8fe52e588f6d0cd1c shipit-source-id: e67f028c914b64424458dad8fe52e588f6d0cd1c
- Loading branch information
Showing
5 changed files
with
96 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
{ | ||
"scripts": { | ||
"start": "node server/server.js", | ||
"start": "RN_VERSION=next node server/server.js", | ||
"gh-pages": "node publish-gh-pages.js" | ||
}, | ||
"dependencies": { | ||
"bluebird": "^2.9.21", | ||
"connect": "2.8.3", | ||
"esprima-fb": "latest", | ||
"fs.extra": "latest", | ||
"glob": "latest", | ||
"jstransform": "latest", | ||
"mkdirp": "latest", | ||
"esprima-fb": "15001.1001.0-dev-harmony-fb", | ||
"fs.extra": "1.3.2", | ||
"glob": "6.0.4", | ||
"jstransform": "11.0.3", | ||
"mkdirp": "^0.5.1", | ||
"optimist": "0.6.0", | ||
"react": "~0.13.0", | ||
"react-docgen": "^2.0.1", | ||
"react-page-middleware": "git://github.com/facebook/react-page-middleware.git", | ||
"request": "latest", | ||
"request": "^2.69.0", | ||
"semver-compare": "^1.0.0", | ||
"shelljs": "^0.6.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* Copyright (c) 2015-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
*/ | ||
|
||
var React = require('React'); | ||
var Site = require('Site'); | ||
var Metadata = require('Metadata'); | ||
|
||
var versions = React.createClass({ | ||
render: function() { | ||
|
||
var availableDocs = (Metadata.config.RN_AVAILABLE_DOCS_VERSIONS || '').split(','); | ||
var versions = [ | ||
{ | ||
title: 'next', | ||
path: '/react-native/releases/next', | ||
}, | ||
{ | ||
title: 'stable', | ||
path: '/react-native', | ||
}, | ||
].concat(availableDocs.map((version) => { | ||
return { | ||
title: version, | ||
path: '/react-native/releases/' + version | ||
} | ||
})); | ||
var versionsLi = versions.map((version) => | ||
<li><a href={version.path}>{version.title}</a></li> | ||
); | ||
return ( | ||
<Site section="versions" title="Documentation archive"> | ||
<section className="content wrap versions documentationContent"> | ||
<h1>Documentation archive</h1> | ||
<ul> | ||
{versionsLi} | ||
</ul> | ||
</section> | ||
</Site> | ||
); | ||
} | ||
}); | ||
|
||
module.exports = versions; |