Skip to content

Commit

Permalink
Merge branch 'master' of github.com:supabase/supabase
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwicopple committed Feb 2, 2021
2 parents 9eda68b + d686518 commit c9751d5
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 16 deletions.
4 changes: 4 additions & 0 deletions vercel-local.json
Expand Up @@ -4,6 +4,10 @@
{ "source": "/", "destination": "http://localhost:3000/new" },
{ "source": "/beta", "destination": "http://localhost:3000/new/beta" },
{ "source": "/:name.:extension", "destination": "http://localhost:3005/:name.:extension" },
{
"source": "/:asset/:name.:extension",
"destination": "http://localhost:3005/:asset/:name.:extension"
},
{ "source": "/:match*", "destination": "http://localhost:3005/:match*/" }
],
"redirects": [
Expand Down
4 changes: 1 addition & 3 deletions web/docusaurus.config.js
Expand Up @@ -47,9 +47,6 @@ module.exports = {
},
image: '/img/supabase-og-image.png', // used for meta tag, in particular og:image and twitter:image
metaImage: '/img/supabase-og-image.png',
googleAnalytics: {
trackingID: 'UA-155232740-1',
},
navbar: {
// classNames: 'shadow--md',
// title: 'supabase',
Expand Down Expand Up @@ -244,6 +241,7 @@ module.exports = {
},
],
],
scripts: [{ src: '/scripts/telemetry.js' }],
// plugins: [
// // [
// // '@docusaurus/plugin-content-docs',
Expand Down
33 changes: 33 additions & 0 deletions www/pages/_app.tsx
@@ -1,6 +1,39 @@
import { AppProps } from 'next/app'
import { useRouter } from 'next/router'
import { useEffect } from 'react'
import '../styles/index.css'
import { post } from './../lib/fetchWrapper'

export default function MyApp({ Component, pageProps }: AppProps) {
const router = useRouter()

function telemetry() {
return post(`https://app.supabase.io/api/telemetry/page`, {
referrer: document.referrer,
title: document.title,
})
}

useEffect(() => {
// `routeChangeComplete` won't run for the first page load unless the query string is
// hydrated later on, so here we log a page view if this is the first render and
// there's no query string
if (!router.asPath.includes('?')) {
telemetry()
}
}, [])

useEffect(() => {
function handleRouteChange() {
telemetry()
}

// Listen for page changes after a navigation or when the query changes
router.events.on('routeChangeComplete', handleRouteChange)
return () => {
router.events.off('routeChangeComplete', handleRouteChange)
}
}, [router.events])

return <Component {...pageProps} />
}
14 changes: 1 addition & 13 deletions www/pages/_document.tsx
Expand Up @@ -11,19 +11,7 @@ export default class MyDocument extends Document {
render() {
return (
<Html lang="en" className="dark">
<Head>
<script
dangerouslySetInnerHTML={{
__html: `(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-155232740-1', 'auto');
ga('send', 'pageview');`,
}}
/>
</Head>
<Head></Head>
<body>
<Main />
<NextScript />
Expand Down

3 comments on commit c9751d5

@vercel
Copy link

@vercel vercel bot commented on c9751d5 Feb 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on c9751d5 Feb 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./web

docs-rose.vercel.app
docs.supabase.vercel.app
docs-git-master.supabase.vercel.app

@vercel
Copy link

@vercel vercel bot commented on c9751d5 Feb 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

www – ./www

www-git-master.supabase.vercel.app
www-alpha.vercel.app
www.supabase.vercel.app

Please sign in to comment.