From f3869bc5758e9b5d903e22e95c63c8f769c60005 Mon Sep 17 00:00:00 2001 From: Anton Nikolaev Date: Fri, 28 Jan 2022 09:46:12 -0800 Subject: [PATCH] Fix loading of google anaytics script Summary: Flipper docs were loading really slowly and I found in dev tools that was becuase of requests to scripts specified in docusaurus config which were not found because of relative urls used. This diff fixes that by specifying absolute URL for script loading. {F696549860} Reviewed By: jknoxville Differential Revision: D33845659 fbshipit-source-id: 5079dba442f5fdf4b4f3b2a64146535b39ea72a4 --- website/docusaurus.config.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index bf49e1081..aeb70817e 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -12,16 +12,17 @@ const {fbContent, fbInternalOnly} = require('internaldocs-fb-helpers'); // end-import-example const repoUrl = 'https://github.com/facebook/flipper'; +const siteUrl = fbContent({ + internal: 'https://flipper.thefacebook.com/', + external: 'https://fbflipper.com/', +}); const siteConfig = { title: fbContent({ internal: 'Flipper @FB', external: 'Flipper', }), tagline: 'Extensible mobile app debugging', - url: fbContent({ - internal: 'https://flipper.thefacebook.com/', - external: 'https://fbflipper.com/', - }), + url: siteUrl, baseUrl: '/', trailingSlash: true, projectName: 'flipper', @@ -160,8 +161,8 @@ const siteConfig = { scripts: [ 'https://buttons.github.io/buttons.js', 'https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js', - 'js/code-blocks-buttons.js', - 'js/google-analytics.js', + `${siteUrl}js/code-blocks-buttons.js`, + `${siteUrl}js/google-analytics.js`, ], stylesheets: [], // start_config_example