diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 366e2516c..eacc8c18f 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -7,17 +7,22 @@ * @format */ +function FBInternalWithOssFallback(elements, fallback) { + return process.env.FB_INTERNAL ? elements : fallback; +} + const repoUrl = 'https://github.com/facebook/flipper'; const siteConfig = { - title: 'Flipper', + title: FBInternalWithOssFallback('Flipper @FB', 'Flipper'), tagline: 'Extensible mobile app debugging', - url: 'https://fbflipper.com/', + url: FBInternalWithOssFallback('https://flipper.thefacebook.com/', 'https://fbflipper.com/'), baseUrl: '/', projectName: 'flipper', + // TODO: T69061026 enable once sandy docs are complete: external_domain: 'fbflipper.com', themeConfig: { navbar: { - title: 'Flipper', + title: FBInternalWithOssFallback('Flipper @FB', 'Flipper'), logo: { alt: 'Flipper Logo', src: 'img/icon.png', @@ -65,13 +70,13 @@ const siteConfig = { title: "I'm a dolphin not a whale!", }, }, - algolia: { + algolia: FBInternalWithOssFallback(undefined, { apiKey: '2df980e7ffc95c19552790f7cad32666', indexName: 'fbflipper', algoliaOptions: { hitsPerPage: 5, }, - }, + }), prism: { additionalLanguages: ['groovy', 'java', 'kotlin', 'ruby', 'swift'], }, @@ -93,7 +98,7 @@ const siteConfig = { { docs: { path: '../docs', - sidebarPath: require.resolve('./sidebars.json'), + sidebarPath: require.resolve('./sidebars.js'), editUrl: 'https://github.com/facebook/flipper/blob/master/website', }, theme: { diff --git a/website/sidebars.json b/website/sidebars.js similarity index 76% rename from website/sidebars.json rename to website/sidebars.js index 3e6d47b23..0aac5a4b5 100644 --- a/website/sidebars.json +++ b/website/sidebars.js @@ -1,4 +1,25 @@ -{ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + + /** + Adds content only if building internal FB version of documentations + e.g. ...FBInternalOnly({'sected-id'}) +*/ +function FBInternalOnly(elements) { + return process.env.FB_INTERNAL ? elements : []; +} + +function NotInFBInternal(elements) { + return process.env.FB_INTERNAL ? [] : elements; +} + +module.exports = { "features": { "Features": [ "features/index", @@ -68,7 +89,10 @@ "extending/send-data", "extending/error-handling", "extending/testing", - "extending/debugging" + "extending/debugging", + ...FBInternalOnly([ // TODO: Remove once sandy is public T69061061 + "extending/fb/sandy/sandy-plugins" + ]) ], "Other Platforms": [ "extending/new-clients",