Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Temporarily adding fullstory. PLEASE REMOVE AFTER TESTING

Paul Copplestone839f1ede9565
diff --git a/web/docusaurus.config.js b/web/docusaurus.config.js
index ff2756661f0..795d8f70e15 100755
--- a/web/docusaurus.config.js
+++ b/web/docusaurus.config.js
@@ -15,6 +15,7 @@ module.exports = {
projectName: 'supabase', // Usually your repo name.
themeConfig: {
darkMode: true,
+ image: 'favicon.png', // used for meta tag, in particular og:image and twitter:image
googleAnalytics: {
trackingID: 'UA-155232740-1',
},
@@ -108,4 +109,26 @@ module.exports = {
},
],
],
+ customFields: {
+ headerJs: `
+ // FULLSTORY - Please remove after initial user testing.
+ window['_fs_debug'] = false;
+ window['_fs_host'] = 'fullstory.com';
+ window['_fs_script'] = 'edge.fullstory.com/s/fs.js';
+ window['_fs_org'] = 'R5A9Z';
+ window['_fs_namespace'] = 'FS';
+ (function(m,n,e,t,l,o,g,y){
+ if (e in m) {if(m.console && m.console.log) { m.console.log('FullStory namespace conflict. Please set window["_fs_namespace"].');} return;}
+ g=m[e]=function(a,b,s){g.q?g.q.push([a,b,s]):g._api(a,b,s);};g.q=[];
+ o=n.createElement(t);o.async=1;o.crossOrigin='anonymous';o.src='https://'+_fs_script;
+ y=n.getElementsByTagName(t)[0];y.parentNode.insertBefore(o,y);
+ g.identify=function(i,v,s){g(l,{uid:i},s);if(v)g(l,v,s)};g.setUserVars=function(v,s){g(l,v,s)};g.event=function(i,v,s){g('event',{n:i,p:v},s)};
+ g.shutdown=function(){g("rec",!1)};g.restart=function(){g("rec",!0)};
+ g.log = function(a,b) { g("log", [a,b]) };
+ g.consent=function(a){g("consent",!arguments.length||a)};
+ g.identifyAccount=function(i,v){o='account';v=v||{};v.acctId=i;g(o,v)};
+ g.clearUserCookie=function(){};
+ })(window,document,window['_fs_namespace'],'script','user');
+ `,
+ },
}
diff --git a/web/src/theme/Layout/index.js b/web/src/theme/Layout/index.js
new file mode 100755
index 00000000000..29d36891a6a
--- /dev/null
+++ b/web/src/theme/Layout/index.js
@@ -0,0 +1,76 @@
+/**
+ * Copyright (c) 2017-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+import React from 'react';
+import Head from '@docusaurus/Head';
+import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
+import useBaseUrl from '@docusaurus/useBaseUrl';
+import Navbar from '@theme/Navbar';
+import Footer from '@theme/Footer';
+
+import './styles.css';
+
+function Layout(props) {
+ const {siteConfig = {}} = useDocusaurusContext();
+ const {
+ favicon,
+ tagline,
+ title: defaultTitle,
+ themeConfig: { image: defaultImage },
+ url: siteUrl,
+ customFields: { headerJs },
+ } = siteConfig
+ const {
+ children,
+ title,
+ noFooter,
+ description,
+ image,
+ keywords,
+ permalink,
+ version,
+ } = props;
+ const metaTitle = title || `${defaultTitle} · ${tagline}`;
+ const metaImage = image || defaultImage;
+ const metaImageUrl = siteUrl + useBaseUrl(metaImage);
+ const faviconUrl = useBaseUrl(favicon);
+ return (
+ <>
+ <Head>
+ {/* TODO: Do not assume that it is in english language */}
+ <html lang="en" />
+
+ <meta httpEquiv="x-ua-compatible" content="ie=edge" />
+ {metaTitle && <title>{metaTitle}</title>}
+ {metaTitle && <meta property="og:title" content={metaTitle} />}
+ {favicon && <link rel="shortcut icon" href={faviconUrl} />}
+ {description && <meta name="description" content={description} />}
+ {description && (
+ <meta property="og:description" content={description} />
+ )}
+ {version && <meta name="docsearch:version" content={version} />}
+ {keywords && keywords.length && (
+ <meta name="keywords" content={keywords.join(',')} />
+ )}
+ {metaImage && <meta property="og:image" content={metaImageUrl} />}
+ {metaImage && <meta property="twitter:image" content={metaImageUrl} />}
+ {metaImage && (
+ <meta name="twitter:image:alt" content={`Image for ${metaTitle}`} />
+ )}
+ {permalink && <meta property="og:url" content={siteUrl + permalink} />}
+ <meta name="twitter:card" content="summary" />
+
+ {headerJs && <script>{headerJs}</script>}
+ </Head>
+ <Navbar />
+ <div className="main-wrapper">{children}</div>
+ {!noFooter && <Footer />}
+ </>
+ );
+}
+
+export default Layout;
diff --git a/web/src/theme/Layout/styles.css b/web/src/theme/Layout/styles.css
new file mode 100755
index 00000000000..8288f6ed800
--- /dev/null
+++ b/web/src/theme/Layout/styles.css
@@ -0,0 +1,27 @@
+/**
+ * Copyright (c) 2017-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+html,
+body {
+ height: 100%;
+}
+
+body {
+ margin: 0;
+ transition: var(--ifm-transition-fast) ease color;
+}
+
+body > div {
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+}
+
+.main-wrapper {
+ flex: 1 0 auto;
+ margin-top: var(--ifm-navbar-height);
+}