diff --git a/website/core/HeaderLinks.js b/website/core/HeaderLinks.js index 93f5948490d..cbe31f822e1 100644 --- a/website/core/HeaderLinks.js +++ b/website/core/HeaderLinks.js @@ -15,8 +15,8 @@ var AlgoliaDocSearch = require('AlgoliaDocSearch'); var HeaderLinks = React.createClass({ linksInternal: [ {section: 'docs', href: 'docs/getting-started.html', text: 'Docs', target: '.nav-docs'}, - {section: 'support', href: 'support.html', text: 'Support'}, - {section: 'showcase', href: 'showcase.html', text: 'Showcase'}, + {section: 'support', href: '/react-native/support.html', text: 'Support'}, + {section: 'showcase', href: '/react-native/showcase.html', text: 'Showcase'}, {section: 'blog', href: '/react-native/blog/', text: 'Blog'}, ], linksExternal: [ diff --git a/website/publish-gh-pages.js b/website/publish-gh-pages.js index 36835275d92..ee8fafacb7f 100644 --- a/website/publish-gh-pages.js +++ b/website/publish-gh-pages.js @@ -23,12 +23,12 @@ if (!which(`git`)) { } let version; -let isBlogToBeDeployed = false; +let areVersionlessSectionsToBeDeployed = false; if (CIRCLE_BRANCH.indexOf(`-stable`) !== -1) { version = CIRCLE_BRANCH.slice(0, CIRCLE_BRANCH.indexOf(`-stable`)); } else if (CIRCLE_BRANCH === `master`) { version = `next`; - isBlogToBeDeployed = true; + areVersionlessSectionsToBeDeployed = true; } rm(`-rf`, `build`); @@ -85,8 +85,9 @@ if (!CI_PULL_REQUEST && CIRCLE_PROJECT_USERNAME === `facebook`) { exit(1); } cd(`build/react-native-gh-pages`); + // blog, showcase, support are copied separately let toCopy = ls(`../react-native`) - .filter(file => file !== `blog`) + .filter(file => (file !== `blog`) && (file !== `showcase.html`) && (file !== `support.html`)) .map(file => `../react-native/${file}`); cp(`-R`, toCopy, `releases/${version}`); // versions.html is located in root of website and updated with every release @@ -96,7 +97,7 @@ if (!CI_PULL_REQUEST && CIRCLE_PROJECT_USERNAME === `facebook`) { if (currentCommit === latestTagCommit) { echo(`------------ DEPLOYING latest`); // leave only releases and blog folder - rm(`-rf`, ls(`*`).filter(name => (name !== 'releases') && (name !== 'blog'))); + rm(`-rf`, ls(`*`).filter(name => (name !== 'releases') && (name !== 'blog') && (name !== 'showcase.html') && (name !== 'support.html'))); cd(`../..`); if (exec(`RN_VERSION=${version} RN_LATEST_VERSION=${latestVersion} \ RN_AVAILABLE_DOCS_VERSIONS=${versions} node server/generate.js`).code !== 0) { @@ -104,17 +105,21 @@ if (!CI_PULL_REQUEST && CIRCLE_PROJECT_USERNAME === `facebook`) { exit(1); } cd(`build/react-native-gh-pages`); - // blog is copied separately + // blog, showcase, support are copied separately let toCopy = ls(`../react-native`) - .filter(file => file !== `blog`) + .filter(file => (file !== `blog`) && (file !== `showcase.html`) && (file !== `support.html`)) .map(file => `../react-native/${file}`); cp(`-R`, toCopy, `.`); } - // blog is versionless, we always build it in root file - if (isBlogToBeDeployed) { + // blog, showcase, support are versionless, we always build them in root file + if (areVersionlessSectionsToBeDeployed) { echo(`------------ COPYING blog`); rm(`-rf`, `blog`); cp(`-R`, `../react-native/blog`, `.`); + echo(`------------ COPYING showcase`); + cp(`../react-native/showcase.html`, `.`); + echo(`------------ COPYING support`); + cp(`../react-native/support.html`, `.`); } if (currentCommit === latestTagCommit || version) { exec(`git status`);