Skip to content

Commit

Permalink
Add redirect to internal documentation for Meta employees (#175)
Browse files Browse the repository at this point in the history
Employees visiting cgsql.dev should be redirected to the internal CQL docs site.

Co-authored-by: Tim Cheung <timcheung@fb.com>
  • Loading branch information
timch326 and Tim Cheung committed May 1, 2023
1 parent 790e6f7 commit c32ca40
Show file tree
Hide file tree
Showing 3 changed files with 2,092 additions and 56 deletions.
38 changes: 26 additions & 12 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
* @format
*/

const path = require('path');
const {fbContent} = require('docusaurus-plugin-internaldocs-fb/internal');

module.exports = {
title: 'CG/SQL',
title: fbContent({
internal: 'CQL Internal',
external: 'CG/SQL',
}),
tagline: 'Code Generator for SQLite',
url: 'https://cgsql.dev',
baseUrl: '/',
Expand All @@ -28,7 +31,10 @@ module.exports = {
isCloseable: false,
},
navbar: {
title: 'CG/SQL',
title:fbContent({
internal: 'CQL',
external: 'CG/SQL',
}),
items: [
{
to: 'docs/introduction',
Expand Down Expand Up @@ -116,16 +122,19 @@ module.exports = {
// Please do not remove the credits, help to publicize Docusaurus :)
copyright: `Copyright © ${new Date().getFullYear()} Meta Platforms, Inc. Built with Docusaurus.`,
},
algolia: {
// The application ID provided by Algolia
appId: '1HF376U378',
algolia: fbContent({
internal: undefined,
external: {
// The application ID provided by Algolia
appId: '1HF376U378',

// Public API key: it is safe to commit it
apiKey: '0e77fa21bce01bba99cad9686e21decb',
// Public API key: it is safe to commit it
apiKey: '0e77fa21bce01bba99cad9686e21decb',

indexName: 'cgsql',
searchPagePath: 'search',
},
indexName: 'cgsql',
searchPagePath: 'search',
},
}),
},
plugins: [
[
Expand All @@ -143,7 +152,7 @@ module.exports = {
],
presets: [
[
'@docusaurus/preset-classic',
require.resolve('docusaurus-plugin-internaldocs-fb/docusaurus-preset'),
{
docs: {
path: '../docs',
Expand All @@ -162,10 +171,15 @@ module.exports = {
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
staticDocsProject: 'cql',
trackingFile: 'xplat/staticdocs/WATCHED_FILES',
sitemap: {
ignorePatterns: ['/cql-guide/generated/*'],
},
},
],
],
customFields: {
fbRepoName: 'fbsource',
},
};
5 changes: 3 additions & 2 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
"@docusaurus/preset-classic": "^2.3.0",
"@mdx-js/react": "^1.5.8",
"clsx": "^1.1.1",
"docusaurus-plugin-internaldocs-fb": "^1.10.1",
"html-loader": "^1.3.2",
"my-loaders": "file:plugins/my-loaders",
"react": "^16.8.4",
"react-dom": "^16.8.4"
"react": "^17.0.1",
"react-dom": "^17.0.1"
},
"devDependencies": {
"babel-eslint": "^10.0.3",
Expand Down

0 comments on commit c32ca40

Please sign in to comment.