From 05761de0ed2685449bcdca8095c0671d800a356d Mon Sep 17 00:00:00 2001 From: Eli Kinsey Date: Thu, 12 Jan 2023 03:35:09 -0800 Subject: [PATCH] remove netlify from codebase (#5064) --- .github/workflows/checks.yml | 34 - .gitignore | 2 - contents/handbook/company/new-to-github.md | 2 +- .../posthog-com/developing-the-website.md | 21 +- contents/handbook/growth/marketing/blog.md | 2 +- functions/apply.js | 67 - functions/ask-a-question.js | 142 - functions/customer.js | 22 - functions/hubspot.js | 40 - functions/mailchimp.js | 22 - functions/slack-question.js | 525 ---- functions/slack-users-question.js | 114 - netlify.toml | 2574 ----------------- package.json | 1 - scripts/safe_rename.js | 147 - scripts/safe_rename.test.js | 151 - .../CommunityQuestions/AskAQuestion.js | 79 - .../CommunityQuestions/AskQuestion.js | 80 - .../CommunityQuestions/EmailSubmitted.js | 54 - src/components/CommunityQuestions/Question.js | 78 - .../CommunityQuestions/QuestionSubmitted.js | 27 - src/components/CommunityQuestions/RichText.js | 128 - .../CommunityQuestions/SubmitEmail.js | 27 - .../CommunityQuestions/Subscribed.js | 30 - src/components/CommunityQuestions/avatar.png | Bin 2554 -> 0 bytes .../CommunityQuestions/email-saved.svg | 32 - 26 files changed, 9 insertions(+), 4392 deletions(-) delete mode 100644 functions/apply.js delete mode 100644 functions/ask-a-question.js delete mode 100644 functions/customer.js delete mode 100644 functions/hubspot.js delete mode 100644 functions/mailchimp.js delete mode 100644 functions/slack-question.js delete mode 100644 functions/slack-users-question.js delete mode 100644 netlify.toml delete mode 100644 scripts/safe_rename.js delete mode 100644 scripts/safe_rename.test.js delete mode 100644 src/components/CommunityQuestions/AskAQuestion.js delete mode 100644 src/components/CommunityQuestions/AskQuestion.js delete mode 100644 src/components/CommunityQuestions/EmailSubmitted.js delete mode 100644 src/components/CommunityQuestions/Question.js delete mode 100644 src/components/CommunityQuestions/QuestionSubmitted.js delete mode 100644 src/components/CommunityQuestions/RichText.js delete mode 100644 src/components/CommunityQuestions/SubmitEmail.js delete mode 100644 src/components/CommunityQuestions/Subscribed.js delete mode 100644 src/components/CommunityQuestions/avatar.png delete mode 100644 src/components/CommunityQuestions/email-saved.svg diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 80ce1d870..68789aaac 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -44,37 +44,3 @@ jobs: - name: Push changes run: | git push - - js_checks: - name: Safe Redirects - runs-on: ubuntu-latest - if: github.event.pull_request.head.repo.full_name == github.repository - - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ github.head_ref }} - - uses: actions/setup-node@v2 - with: - node-version: '18' - - name: Install dependencies - run: yarn - - name: Run tests - run: yarn test-redirects - - name: Configure Git - run: | - git fetch origin master:master - git config user.name PostHog Bot - git config user.email hey@posthog.com - - name: Add safe redirects - if: ${{ github.base_ref == 'master' }} - run: yarn generate-redirects - - name: Cleanup and commit - if: ${{ github.base_ref == 'master' }} - run: | - rm pr_diff - git add netlify.toml - [ "$(git status -s)" = "" ] && exit 0 || git commit -m "Add safe redirects (JS)" - - name: Push changes - run: | - git push diff --git a/.gitignore b/.gitignore index 3061ff450..3ba1d0f92 100644 --- a/.gitignore +++ b/.gitignore @@ -22,8 +22,6 @@ pr_diff recipe-server.log -# Local Netlify folder -.netlify static/fonts/MatterSQItalicVF.woff static/fonts/MatterSQItalicVF.woff2 static/fonts/MatterSQVF.woff diff --git a/contents/handbook/company/new-to-github.md b/contents/handbook/company/new-to-github.md index a505f83bc..921d117b1 100644 --- a/contents/handbook/company/new-to-github.md +++ b/contents/handbook/company/new-to-github.md @@ -111,7 +111,7 @@ Near the bottom of a pull request page, you'll see a box like this: (Note: This box only appears if you're a member of the PostHog GitHub org - it's not available to the public.) -You can click the _Details_ link on the line that says `netlify/posthog/deploy-preview` to see the preview. +You can click the _Visit Preview_ link in the Vercel bot comment to see the preview. ### Merging changes diff --git a/contents/handbook/engineering/posthog-com/developing-the-website.md b/contents/handbook/engineering/posthog-com/developing-the-website.md index 1263d74cd..aeef0ebba 100644 --- a/contents/handbook/engineering/posthog-com/developing-the-website.md +++ b/contents/handbook/engineering/posthog-com/developing-the-website.md @@ -371,27 +371,20 @@ The sidebar is generated from each of the files in `/src/sidebars`. #### Redirects -Redirects are managed in `netlify.toml` which is located in the root folder. +Redirects are managed in `vercel.json` which is located in the root folder. -To declare a new redirect, open `netlify.toml` and add an entry with the `[[redirects]]` heading: +To declare a new redirect, open `vercel.json` and add an entry to the `redirects` list: ``` -[[redirects]] - from = "/docs/integrations/android-integration" - to = "/docs/libraries/android" +{ "source": "/docs/contributing/stack", "destination": "/docs/contribute/stack" } ``` -The default HTTP status code is 301, but if you need to define a different status code, it can be changed like this: +The default HTTP status code is 308 (permanent), but if the redirect should be temporary (307), it can be updated like this: ``` -[[redirects]] - from = "/docs/integrations/android-integration" - to = "/docs/libraries/android" - status = 302 +{ "source": "/docs/contributing/stack", "destination": "/docs/contribute/stack", "permanent": false } ``` -> If you ever need to rename a file to get a different slug, a redirect is automatically created with the Safe Redirects action - ## Committing changes It's best to create commits that are focused on one specific area. For example, create one commit for textual changes and another for functional ones. Another example is creating a commit for changes to a section of the handbook and a different commit for updates to the documentation. This helps the pull request review process and also means specific commits can be [cherry picked](https://git-scm.com/docs/git-cherry-pick). @@ -508,7 +501,7 @@ If you know who you would like to review the pull request, select them in the ** ## Preview branch -After a series of checks are run (to ensure nothing in your pull request breaks the website), Netlify will generate a preview link available on the `netlify/posthog/deploy-preview` line. This includes all of your changes so you can preview before your pull request is merged. +After a series of checks are run (to ensure nothing in your pull request breaks the website), Vercel will generate a preview link available in the Vercel bot comment. This includes all of your changes so you can preview before your pull request is merged. ![Preview branch](../../../images/docs/contribute/preview-branch.png) @@ -520,4 +513,4 @@ To get changes into production, the website deploys automatically from `master`. #### Acknowledgements -This website is based on [Gatsby](https://gatsbyjs.org) and is hosted with [Netlify](https://www.netlify.com/). +This website is based on [Gatsby](https://gatsbyjs.org) and is hosted with [Vercel](https://vercel.com). diff --git a/contents/handbook/growth/marketing/blog.md b/contents/handbook/growth/marketing/blog.md index 4741e7bf7..4d0b85953 100644 --- a/contents/handbook/growth/marketing/blog.md +++ b/contents/handbook/growth/marketing/blog.md @@ -102,7 +102,7 @@ Submit a PR to [posthog/posthog.com](https://github.com/posthog/posthog.com) wit - Add a meta description using `description` in the frontmatter section (optional) -- Set the date of the blog post to the intended publishing date in the format `YYYY-MM-DD`. Posts dated [in the future](https://github.com/PostHog/posthog.com/pull/2964) won't display on the site until their specified date, though a build is required day-of in order to publish the post. (The Website & Docs team or other Netlify admins can kick off a manual build.) +- Set the date of the blog post to the intended publishing date in the format `YYYY-MM-DD`. Posts dated [in the future](https://github.com/PostHog/posthog.com/pull/2964) won't display on the site until their specified date, though a build is required day-of in order to publish the post. (The Website & Docs team or other Vercel admins can kick off a manual build.) - Create an annotation on [app.posthog.com](https://app.posthog.com) for the content to track the effect. diff --git a/functions/apply.js b/functions/apply.js deleted file mode 100644 index 76c8e0d9e..000000000 --- a/functions/apply.js +++ /dev/null @@ -1,67 +0,0 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ -const Busboy = require('busboy') -const request = require('request') - -function multipartToAshby(event) { - return new Promise((resolve) => { - const applicationForm = { fieldSubmissions: [] } - const formData = {} - const busboy = Busboy({ - headers: event.headers, - }) - - busboy.on('file', (name, filestream, file) => { - filestream.on('data', (data) => { - formData[name] = { - value: data, - options: { - filename: file.filename, - contentType: null, - }, - } - }) - }) - - busboy.on('field', (name, value) => { - if (name === 'jobPostingId') { - formData[name] = value - } else { - applicationForm.fieldSubmissions.push({ - path: name, - value, - }) - } - }) - - busboy.on('finish', () => { - formData.applicationForm = JSON.stringify(applicationForm) - resolve(formData) - }) - - busboy.end(Buffer.from(event.body, 'base64')) - }) -} - -exports.handler = async (e) => { - const formData = await multipartToAshby(e) - const options = { - method: 'POST', - url: 'https://api.ashbyhq.com/applicationForm.submit', - headers: { - 'Content-Type': 'multipart/form-data', - Authorization: `Basic ${Buffer.from(`${process.env.ASHBY_API_KEY}:`).toString('base64')}`, - }, - formData, - } - const submission = await new Promise((resolve, reject) => { - request(options, function (err, res) { - if (err) throw new Error(err) - resolve(res.body) - }) - }) - - return { - statusCode: 200, - body: JSON.stringify({ submission }), - } -} diff --git a/functions/ask-a-question.js b/functions/ask-a-question.js deleted file mode 100644 index 500103908..000000000 --- a/functions/ask-a-question.js +++ /dev/null @@ -1,142 +0,0 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ -const fetch = require('node-fetch') -const getGravatar = require('gravatar') - -exports.handler = async (e) => { - let { body } = e - if (!body) return { statusCode: 500, body: 'Missing body' } - body = JSON.parse(body) - let avatar - if (body.email) { - const gravatar = getGravatar.url(body.email) - avatar = await fetch(`https:${gravatar}?d=404`).then((res) => (res.ok && `https:${gravatar}`) || '') - } - - const message = { - channel: process.env.SLACK_QUESTION_CHANNEL, - ts: body.timestamp, - text: body.question, - username: body.name, - blocks: [ - { - type: 'header', - text: { - type: 'plain_text', - text: `${body.name} on ${body.slug}`, - emoji: true, - }, - block_id: 'name_and_slug', - }, - { - type: 'header', - text: { - type: 'plain_text', - text: body.subject, - emoji: true, - }, - block_id: 'subject', - }, - { - type: 'section', - block_id: 'question', - text: { - type: 'mrkdwn', - text: body.question, - }, - ...(avatar && { - accessory: { - type: 'image', - image_url: avatar, - alt_text: body.name, - }, - }), - }, - { - type: 'actions', - elements: [ - { - type: 'button', - style: 'primary', - text: { - type: 'plain_text', - text: `Publish${body.email ? ' & notify' : ''}`, - emoji: true, - }, - value: JSON.stringify({ - question: body.question, - name: body.name, - slug: body.slug, - email: body.email, - subject: body.subject, - avatar, - }), - action_id: 'publish-button', - confirm: { - title: { - type: 'plain_text', - text: 'Please confirm', - }, - text: { - type: 'mrkdwn', - text: `Clicking confirm will add this thread to the website${ - body.email ? ' and send an email to the original poster' : '' - }.`, - }, - confirm: { - type: 'plain_text', - text: 'Confirm', - }, - deny: { - type: 'plain_text', - text: 'Cancel', - }, - }, - }, - { - type: 'button', - text: { - type: 'plain_text', - text: 'Edit', - emoji: true, - }, - value: JSON.stringify({ - question: body.question, - name: body.name, - slug: body.slug, - email: body.email, - subject: body.subject, - }), - action_id: 'edit-question-button', - }, - { - type: 'button', - text: { - type: 'plain_text', - text: 'Open page', - emoji: true, - }, - url: `https://posthog.com${body.slug}`, - action_id: 'open-page-button', - }, - ], - }, - ], - } - - const slack = await fetch( - body.timestamp ? 'https://slack.com/api/chat.update' : 'https://slack.com/api/chat.postMessage', - { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - Authorization: `Bearer ${process.env.SLACK_API_KEY}`, - }, - body: JSON.stringify(message), - } - ).then((res) => res.json()) - - return { - statusCode: 200, - body: JSON.stringify({ timestamp: slack.ts }), - } -} diff --git a/functions/customer.js b/functions/customer.js deleted file mode 100644 index 91da3e5c6..000000000 --- a/functions/customer.js +++ /dev/null @@ -1,22 +0,0 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ -const fetch = require('node-fetch') - -exports.handler = async (e) => { - const { queryStringParameters } = e - const companyName = queryStringParameters.name - let data = {} - if (companyName) { - const clearbitData = await fetch(`https://company.clearbit.com/v1/domains/find?name=${companyName}`, { - headers: { Authorization: `Bearer ${process.env.CLEARBIT_API_KEY}` }, - }).then((res) => res.json()) - const { name, logo } = clearbitData - data = { - name, - logo, - } - } - return { - statusCode: 200, - body: JSON.stringify(data), - } -} diff --git a/functions/hubspot.js b/functions/hubspot.js deleted file mode 100644 index 181ce302d..000000000 --- a/functions/hubspot.js +++ /dev/null @@ -1,40 +0,0 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ -const hubspot = require('@hubspot/api-client') - -exports.handler = async (e) => { - let { body } = e - if (!body) return { statusCode: 500, body: 'Missing body' } - body = JSON.parse(body) - const { email, firstName, lastName } = body - - if (!email || !firstName || !lastName) { - return { - statusCode: 500, - body: 'Missing required fields', - } - } - - const hubspotClient = new hubspot.Client({ accessToken: process.env.HUBSPOT_ACCESS_TOKEN }) - - const properties = { - email, - firstname: firstName, - lastname: lastName, - } - const SimplePublicObjectInput = { properties } - - try { - const apiResponse = await hubspotClient.crm.contacts.basicApi.create(SimplePublicObjectInput) - console.log(JSON.stringify(apiResponse.body, null, 2)) - } catch (e) { - e.message === 'HTTP request failed' ? console.error(JSON.stringify(e.response, null, 2)) : console.error(e) - return { - statusCode: 500, - body: 'HubSpot request failed', - } - } - - return { - statusCode: 200, - } -} diff --git a/functions/mailchimp.js b/functions/mailchimp.js deleted file mode 100644 index 14000a25f..000000000 --- a/functions/mailchimp.js +++ /dev/null @@ -1,22 +0,0 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ -const fetch = require('node-fetch') -const md5 = require('md5') - -exports.handler = async (e) => { - let { body } = e - if (!body) return { statusCode: 500, body: 'Missing body' } - body = JSON.parse(body) - const { email, tag } = body - if (!email || !tag) return { statusCode: 500, body: 'Missing required fields' } - const data = await fetch(`https://us19.api.mailchimp.com/3.0/lists/ef3044881e/members/${md5(email)}/tags`, { - headers: { - Authorization: `Bearer ${process.env.MAILCHIMP_API_KEY}`, - }, - method: 'POST', - body: JSON.stringify({ tags: [{ name: tag, status: 'active' }], is_syncing: false }), - }) - return { - statusCode: 200, - body: JSON.stringify(data), - } -} diff --git a/functions/slack-question.js b/functions/slack-question.js deleted file mode 100644 index 8f189c025..000000000 --- a/functions/slack-question.js +++ /dev/null @@ -1,525 +0,0 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ -const fetch = require('node-fetch') -const queryString = require('query-string') -const formData = require('form-data') -const Mailgun = require('mailgun.js') -const getGravatar = require('gravatar') -const { App, AwsLambdaReceiver } = require('@slack/bolt') - -const awsLambdaReceiver = new AwsLambdaReceiver({ - signingSecret: process.env.SLACK_SIGNING_SECRET, -}) - -const app = new App({ - signingSecret: process.env.SLACK_SIGNING_SECRET, - token: process.env.SLACK_API_KEY, - receiver: awsLambdaReceiver, -}) - -app.view('submit-button', async ({ ack, view, client }) => { - await ack() - const { - private_metadata, - state: { values }, - } = view - - const body = { - slug: null, - name: null, - email: null, - question: null, - subject: null, - } - - Object.keys(values).forEach((valueKey) => { - Object.keys(body).forEach((bodyKey) => { - if (values[valueKey][bodyKey]) { - body[bodyKey] = values[valueKey][bodyKey].value - } - }) - }) - - body.timestamp = private_metadata - - let avatar - if (body.email) { - const gravatar = getGravatar.url(body.email) - avatar = await fetch(`https:${gravatar}?d=404`).then((res) => (res.ok && `https:${gravatar}`) || '') - } - - const message = { - channel: process.env.SLACK_QUESTION_CHANNEL, - ts: body.timestamp, - text: body.question, - username: body.name, - blocks: [ - { - type: 'header', - text: { - type: 'plain_text', - text: `${body.name} on ${body.slug}`, - emoji: true, - }, - block_id: 'name_and_slug', - }, - { - type: 'header', - text: { - type: 'plain_text', - text: body.subject, - emoji: true, - }, - block_id: 'subject', - }, - { - type: 'section', - block_id: 'question', - text: { - type: 'mrkdwn', - text: body.question, - }, - ...(avatar && { - accessory: { - type: 'image', - image_url: avatar, - alt_text: body.name, - }, - }), - }, - { - type: 'actions', - elements: [ - { - type: 'button', - style: 'primary', - text: { - type: 'plain_text', - text: 'Publish', - emoji: true, - }, - value: JSON.stringify({ - question: body.question, - name: body.name, - slug: body.slug, - email: body.email, - subject: body.subject, - avatar, - }), - action_id: 'publish-button', - confirm: { - title: { - type: 'plain_text', - text: 'Please confirm', - }, - text: { - type: 'mrkdwn', - text: 'Clicking confirm will add this thread to the website.', - }, - confirm: { - type: 'plain_text', - text: 'Confirm', - }, - deny: { - type: 'plain_text', - text: 'Cancel', - }, - }, - }, - { - type: 'button', - text: { - type: 'plain_text', - text: 'Edit', - emoji: true, - }, - value: JSON.stringify({ - question: body.question, - name: body.name, - slug: body.slug, - email: body.email, - subject: body.subject, - timestamp: body.timestamp, - }), - action_id: 'edit-question-button', - }, - { - type: 'button', - text: { - type: 'plain_text', - text: 'Open page', - emoji: true, - }, - url: `https://posthog.com${body.slug}`, - action_id: 'open-page-button', - }, - ], - }, - ], - } - - client.chat.update(message) -}) - -app.action('edit-question-button', async ({ ack, client, body, logger }) => { - await ack() - try { - const { question, name, email, slug, subject } = JSON.parse(body.actions[0].value) - const result = await client.views.open({ - trigger_id: body.trigger_id, - view: { - callback_id: 'submit-button', - private_metadata: body.message.ts, - type: 'modal', - title: { - type: 'plain_text', - text: `Question`, - emoji: true, - }, - submit: { - type: 'plain_text', - text: 'Save', - emoji: true, - }, - close: { - type: 'plain_text', - text: 'Cancel', - emoji: true, - }, - blocks: [ - { - type: 'input', - element: { - type: 'plain_text_input', - action_id: 'slug', - initial_value: slug, - }, - label: { - type: 'plain_text', - text: 'Slug', - emoji: true, - }, - }, - { - type: 'input', - element: { - type: 'plain_text_input', - action_id: 'subject', - initial_value: subject, - }, - label: { - type: 'plain_text', - text: 'Subject', - emoji: true, - }, - }, - { - type: 'input', - element: { - type: 'plain_text_input', - action_id: 'name', - initial_value: name, - }, - label: { - type: 'plain_text', - text: 'Name', - emoji: true, - }, - }, - { - type: 'input', - optional: true, - element: { - type: 'plain_text_input', - action_id: 'email', - initial_value: email || '', - }, - label: { - type: 'plain_text', - text: 'Email', - emoji: true, - }, - }, - { - type: 'input', - element: { - type: 'plain_text_input', - multiline: true, - action_id: 'question', - initial_value: question, - }, - label: { - type: 'plain_text', - text: 'Question', - emoji: true, - }, - }, - ], - }, - }) - } catch (error) { - logger.error(error) - } -}) - -app.action('unpublish-button', async ({ ack, client, body }) => { - await ack() - const { message, actions } = body - const { name, slug, question, avatar, email, subject } = JSON.parse(actions[0].value) - const messageUpdate = { - channel: process.env.SLACK_QUESTION_CHANNEL, - ts: message.ts, - text: question, - username: name, - blocks: [ - { - type: 'header', - text: { - type: 'plain_text', - text: `${name} on ${slug}`, - emoji: true, - }, - block_id: 'name_and_slug', - }, - { - type: 'header', - text: { - type: 'plain_text', - text: subject, - emoji: true, - }, - block_id: 'subject', - }, - { - type: 'section', - block_id: 'question', - text: { - type: 'mrkdwn', - text: question, - }, - ...(avatar && { - accessory: { - type: 'image', - image_url: avatar, - alt_text: name, - }, - }), - }, - { - type: 'actions', - elements: [ - { - type: 'button', - style: 'primary', - text: { - type: 'plain_text', - text: 'Publish', - emoji: true, - }, - value: JSON.stringify({ - question: question, - name: name, - slug: slug, - email: email, - avatar, - }), - action_id: 'publish-button', - confirm: { - title: { - type: 'plain_text', - text: 'Please confirm', - }, - text: { - type: 'mrkdwn', - text: 'Clicking confirm will add this thread to the website.', - }, - confirm: { - type: 'plain_text', - text: 'Confirm', - }, - deny: { - type: 'plain_text', - text: 'Cancel', - }, - }, - }, - { - type: 'button', - text: { - type: 'plain_text', - text: 'Edit', - emoji: true, - }, - value: JSON.stringify({ - question: question, - name: name, - slug: slug, - email: email, - }), - action_id: 'edit-question-button', - }, - { - type: 'button', - text: { - type: 'plain_text', - text: 'Open page', - emoji: true, - }, - url: `https://posthog.com${slug}`, - action_id: 'open-page-button', - }, - ], - }, - ], - } - - client.chat.update(messageUpdate) -}) - -app.action('publish-button', async ({ ack, client, body }) => { - await ack() - const { message, actions } = body - const { question, name, slug, email, avatar, subject } = JSON.parse(actions[0].value) - const replies = await client.conversations.replies({ - ts: message.ts, - channel: process.env.SLACK_QUESTION_CHANNEL, - }) - - const answer = replies.messages && replies.messages[1] && replies.messages[1].text - if (answer) { - if (email) { - const mailgun = new Mailgun(formData) - const mg = mailgun.client({ - username: 'api', - key: process.env.MAILGUN_API_KEY, - url: 'https://api.eu.mailgun.net', - }) - const mailgunData = { - from: 'hey@posthog.com', - to: email, - subject: `Someone answered your question on posthog.com!`, - template: 'question-answered', - 'h:X-Mailgun-Variables': JSON.stringify({ - question, - answer, - }), - 'h:Reply-To': 'hey@posthog.com', - } - await mg.messages.create(process.env.MAILGUN_DOMAIN, mailgunData).catch((err) => console.log(err)) - } - const messageUpdate = { - channel: process.env.SLACK_QUESTION_CHANNEL, - ts: message.ts, - text: question, - username: name, - blocks: [ - { - type: 'header', - text: { - type: 'plain_text', - text: `${name} on ${slug}`, - emoji: true, - }, - block_id: 'name_and_slug', - }, - { - type: 'header', - text: { - type: 'plain_text', - text: subject, - emoji: true, - }, - block_id: 'subject', - }, - { - type: 'section', - block_id: 'question', - text: { - type: 'mrkdwn', - text: question, - }, - ...(avatar && { - accessory: { - type: 'image', - image_url: avatar, - alt_text: name, - }, - }), - }, - { - type: 'section', - block_id: 'published', - text: { - type: 'plain_text', - text: '✅ Published', - emoji: true, - }, - }, - { - type: 'actions', - elements: [ - { - type: 'button', - style: 'danger', - text: { - type: 'plain_text', - text: 'Unpublish', - emoji: true, - }, - value: JSON.stringify({ - question: question, - name: name, - slug: slug, - email: email, - subject: subject, - avatar, - }), - action_id: 'unpublish-button', - confirm: { - title: { - type: 'plain_text', - text: 'Please confirm', - }, - text: { - type: 'mrkdwn', - text: 'Clicking confirm will remove this thread from the website', - }, - confirm: { - type: 'plain_text', - text: 'Confirm', - }, - deny: { - type: 'plain_text', - text: 'Cancel', - }, - }, - }, - { - type: 'button', - text: { - type: 'plain_text', - text: 'Open page', - emoji: true, - }, - url: `https://posthog.com${slug}`, - action_id: 'open-page-button', - }, - ], - }, - ], - } - client.chat.update(messageUpdate) - } -}) - -app.action('open-page-button', async ({ ack }) => { - await ack() -}) - -exports.handler = async (event, context, callback) => { - const { body } = event - const { payload } = queryString.parse(body) - const { token } = JSON.parse(payload) - if (token !== process.env.SLACK_VERIFICATION_TOKEN) return { statusCode: 500, body: 'Invalid token' } - const handler = await awsLambdaReceiver.start() - return handler(event, context, callback) -} diff --git a/functions/slack-users-question.js b/functions/slack-users-question.js deleted file mode 100644 index 7afff079e..000000000 --- a/functions/slack-users-question.js +++ /dev/null @@ -1,114 +0,0 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ -const queryString = require('query-string') -const { App, AwsLambdaReceiver } = require('@slack/bolt') -const { createClient } = require('@supabase/supabase-js') - -const supabase = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_API_KEY) - -const awsLambdaReceiver = new AwsLambdaReceiver({ - signingSecret: process.env.SLACK_USERS_SIGNING_SECRET, -}) - -const app = new App({ - signingSecret: process.env.SLACK_USERS_SIGNING_SECRET, - token: process.env.SLACK_USERS_API_KEY, - receiver: awsLambdaReceiver, -}) - -app.shortcut('publish_thread', async ({ shortcut, ack, client, logger }) => { - try { - await ack() - const user = await client.users.info({ user: shortcut.user.id }) - if (!user.user.is_admin) return - const { data, error } = await supabase - .from('Messages') - .select('slack_timestamp, slug') - .eq('slack_timestamp', shortcut.message.ts) - - const view = { - trigger_id: shortcut.trigger_id, - view: { - private_metadata: JSON.stringify({ - ts: shortcut.message.ts, - channel: shortcut.channel.id, - user: shortcut.user.id, - }), - callback_id: 'submit-db-button', - type: 'modal', - title: { - type: 'plain_text', - text: 'PostHog Q&A', - }, - submit: { - type: 'plain_text', - text: 'Publish', - emoji: true, - }, - close: { - type: 'plain_text', - text: 'Cancel', - emoji: true, - }, - blocks: [ - { - type: 'input', - optional: false, - element: { - type: 'plain_text_input', - action_id: 'slug', - }, - label: { - type: 'plain_text', - text: 'Slug (eg: /docs/api/insights), separated by commas', - emoji: true, - }, - }, - ], - }, - } - if (data.length > 0 && data[0].slug) { - view.view.blocks[0].element.initial_value = data[0].slug - view.view.blocks[0].optional = true - view.view.submit.text = 'Update' - } - await client.views.open(view) - } catch (error) { - logger.error(error) - } -}) - -app.view('submit-db-button', async ({ ack, view }) => { - await ack() - const { - private_metadata, - state: { values }, - } = view - const body = { - slug: null, - } - - const { ts, channel, user } = JSON.parse(private_metadata) - - Object.keys(values).forEach((valueKey) => { - Object.keys(body).forEach((bodyKey) => { - if (values[valueKey][bodyKey]) { - body[bodyKey] = values[valueKey][bodyKey].value - } - }) - }) - - body.slack_timestamp = ts - body.slack_channel = channel - body.slack_user = user - - await supabase.from('Messages').upsert([body]) -}) - -exports.handler = async (event, context, callback) => { - const { body } = event - const { payload } = queryString.parse(body) - const { token } = JSON.parse(payload) - if (token !== process.env.SLACK_USERS_VERIFICATION_TOKEN) return { statusCode: 500, body: 'Invalid token' } - const handler = await awsLambdaReceiver.start() - return handler(event, context, callback) -} diff --git a/netlify.toml b/netlify.toml deleted file mode 100644 index d0c7e30b0..000000000 --- a/netlify.toml +++ /dev/null @@ -1,2574 +0,0 @@ -[build.environment] - NODE_VERSION = "18" - GATSBY_CPU_COUNT = "2" - -[dev] - command = "yarn start" - port = 8888 - targetPort = 8001 - -[[redirects]] - from = "/plugins/*" - to = "/apps/:splat" - -[[redirects]] - from = "/docs/user-guides/*" - to = "/manual/:splat" - -[[redirects]] - from = "/next-steps/*" - to = "/next-steps" - status = 200 - -[[redirects]] - from = "/question/*" - to = "/question" - status = 200 - -[[redirects]] - from = "/careers/*" - to = "/careers" - status = 200 - -[[redirects]] - from = "/docs/integrations/android-integration" - to = "/docs/libraries/android" - - -[[redirects]] - from = "/docs/integrations/community" - to = "/docs/libraries/community" - - -[[redirects]] - from = "/docs/integrations/docusaurus-integration" - to = "/docs/libraries/docusaurus" - - -[[redirects]] - from = "/docs/integrations/elixir-integration" - to = "/docs/libraries/elixir" - - -[[redirects]] - from = "/docs/integrations/flutter-integration" - to = "/docs/libraries/flutter" - - -[[redirects]] - from = "/docs/integrations/gatsby-integration" - to = "/docs/libraries/gatsby" - - -[[redirects]] - from = "/docs/integrations/go-integration" - to = "/docs/libraries/go" - - -[[redirects]] - from = "/docs/integrations/ios-integration" - to = "/docs/libraries/ios" - - -[[redirects]] - from = "/docs/integrations/javascript-integration" - to = "/docs/libraries/js" - -[[redirects]] - from = "/docs/integrations/js-integration" - to = "/docs/libraries/js" - - -[[redirects]] - from = "/docs/integrations/message-formatting" - to = "/docs/libraries/message-formatting" - - -[[redirects]] - from = "/docs/integrations/microsoft-teams" - to = "/docs/libraries/microsoft-teams" - - -[[redirects]] - from = "/docs/integrations/node-integration" - to = "/docs/libraries/node" - - -[[redirects]] - from = "/docs/integrations/php-integration" - to = "/docs/libraries/php" - - -[[redirects]] - from = "/docs/integrations/python-integration" - to = "/docs/libraries/python" - - -[[redirects]] - from = "/docs/integrations/react-native-integration" - to = "/docs/libraries/react-native" - - -[[redirects]] - from = "/docs/integrations/ruby-integration" - to = "/docs/libraries/ruby" - - -[[redirects]] - from = "/docs/integrations/rudderstack-integration" - to = "/docs/libraries/rudderstack" - - -[[redirects]] - from = "/docs/integrations/segment-integration" - to = "/docs/libraries/segment" - - -[[redirects]] - from = "/docs/integrations/sentry-integration" - to = "/docs/libraries/sentry" - - -[[redirects]] - from = "/docs/integrations/slack" - to = "/docs/libraries/slack" - - -[[redirects]] - from = "/handbook/company/structure" - to = "/handbook/people/team-structure/why-small-teams" - - -[[redirects]] - from = "/handbook/people/team" - to = "/handbook/company/team" - - -[[redirects]] - from = "/handbook/growth/customer-success" - to = "/handbook/growth/customer-support" - - -[[redirects]] - from = "/handbook/getting-started" - to = "/handbook/getting-started/start-here" - -[[redirects]] - from = "/handbook/people/team-structure/user-experience" - to = "/handbook/people/team-structure/core-experience" - - -[[redirects]] - from = "/docs/plugins/build/overview" - to = "/docs/apps/build" - - -[[redirects]] - from = "/docs/plugins/types" - to = "/docs/apps/build/types" - -[[redirects]] - from = "/docs/developing-locally" - to = "/docs/contributing/developing-locally" - - -[[redirects]] - from = "/docs/project-structure" - to = "/docs/contributing/project-structure" - - -[[redirects]] - from = "/docs/recognizing-contributions" - to = "/docs/contributing/recognizing-contributions" - - -[[redirects]] - from = "/docs/stack" - to = "/docs/contributing/stack" - - -[[redirects]] - from = "/docs/updating-documentation" - to = "/docs/contributing/updating-documentation" - - -[[redirects]] - from = "/docs/configuring-posthog/scaling-posthog" - to = "/docs/self-host" - -[[redirects]] - from = "/docs/self-host/overview" - to = "/docs/self-host" - - -[[redirects]] - from = "/docs/deployment" - to = "/docs/self-host#deploy" - -[[redirects]] - from = "/docs/self-host/configure" - to = "/docs/self-host#configure" - -[[redirects]] - from = "/docs/configuring-posthog" - to = "/docs/self-host/configure" - -# Modified: 2021-08-03 -[[redirects]] - from = "/docs/features/log-in-with-github-gitlab" - to = "/docs/user-guides/sso" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/contributing/developing-locally" - to = "/docs/contribute/developing-locally" - -# Added: 2021-07-13 Updated: 2021-07-17 -[[redirects]] - from = "/docs/contributing" - to = "/docs/contribute" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/contributing/project-structure" - to = "/docs/contribute/project-structure" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/contributing/recognizing-contributions" - to = "/docs/contribute/recognizing-contributions" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/contributing/stack" - to = "/docs/contribute/stack" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/contributing/updating-documentation" - to = "/docs/contribute/updating-documentation" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/libraries/android" - to = "/docs/integrate/client/android" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/libraries/flutter" - to = "/docs/integrate/client/flutter" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/libraries/ios" - to = "/docs/integrate/client/ios" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/libraries/js" - to = "/docs/integrate/client/js" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/libraries/react-native" - to = "/docs/integrate/client/react-native" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/deployment/snippet-installation" - to = "/docs/integrate/client/snippet-installation" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/libraries/elixir" - to = "/docs/integrate/server/elixir" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/libraries/go" - to = "/docs/integrate/server/go" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/libraries/node" - to = "/docs/integrate/server/node" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/libraries/php" - to = "/docs/integrate/server/php" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/libraries/python" - to = "/docs/integrate/server/python" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/libraries/ruby" - to = "/docs/integrate/server/ruby" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/libraries/docusaurus" - to = "/docs/integrate/third-party/docusaurus" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/libraries/gatsby" - to = "/docs/integrate/third-party/gatsby" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/tutorials/1-minute/integrate-with-gtm" - to = "/docs/integrate/third-party/google-tag-manager" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/tutorials/1-minute/integrate-with-metabase" - to = "/docs/integrate/third-party/metabase" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/tutorials/1-minute/integrate-with-nuxt-js" - to = "/docs/integrate/third-party/nuxt-js" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/tutorials/1-minute/integrate-with-retool" - to = "/docs/integrate/third-party/retool" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/libraries/rudderstack" - to = "/docs/integrate/third-party/rudderstack" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/libraries/segment" - to = "/docs/integrate/third-party/segment" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/libraries/sentry" - to = "/docs/integrate/third-party/sentry" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/tutorials/1-minute/integrate-with-shopify" - to = "/docs/integrate/third-party/shopify" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/tutorials/1-minute/integrate-with-wordpress" - to = "/docs/integrate/third-party/wordpress" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/libraries/message-formatting" - to = "/docs/integrate/webhooks/message-formatting" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/libraries/microsoft-teams" - to = "/docs/integrate/webhooks/microsoft-teams" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/libraries/slack" - to = "/docs/integrate/webhooks/slack" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/configuring-posthog/email" - to = "/docs/self-host/configure/email" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/configuring-posthog/environment-variables" - to = "/docs/self-host/configure/environment-variables" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/configuring-posthog/running-behind-proxy" - to = "/docs/self-host/configure/running-behind-proxy" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/configuring-posthog/securing-posthog" - to = "/docs/self-host/configure/securing-posthog" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/configuring-posthog/upgrading-posthog" - to = "/docs/self-host/configure/upgrading-posthog" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/deployment/deploy-aws-clickhouse" - to = "/docs/self-host/deploy/aws-clickhouse" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/deployment/deploy-aws" - to = "/docs/self-host/deploy/aws" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/deployment/deploy-azure" - to = "/docs/self-host/deploy/azure" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/deployment/deploy-digital-ocean" - to = "/docs/self-host/deploy/digital-ocean" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/deployment/deploy-docker" - to = "/docs/self-host/deploy/docker" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/deployment/deploy-gke-clickhouse" - to = "/docs/self-host/deploy/gke-clickhouse" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/deployment/deploy-gcs" - to = "/docs/self-host/deploy/google-cloud-services" - -# Fixes orphan link(s) -[[redirects]] - from = "/docs/self-host/deploy/gcs" - to = "/docs/self-host/deploy/google-cloud-services" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/deployment/deploy-heroku" - to = "/docs/self-host/deploy/heroku" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/deployment/hosting-costs" - to = "/docs/self-host/deploy/hosting-costs" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/deployment/deploy-kubernetes" - to = "/docs/self-host/deploy/kubernetes" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/deployment/deploy-proxy" - to = "/docs/self-host/deploy/proxy" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/deployment/deploy-qovery" - to = "/docs/self-host/deploy/qovery" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/deployment/deploy-render" - to = "/docs/self-host/deploy/render" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/deployment/deploy-source" - to = "/docs/self-host/deploy/source" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/configuring-posthog/deleting-data" - to = "/docs/tutorials/deleting-data" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/features/actions" - to = "/docs/user-guides/actions" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/features/annotations" - to = "/docs/user-guides/annotations" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/application-settings" - to = "/docs/user-guides/application-settings" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/features/cohorts" - to = "/docs/user-guides/cohorts" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/features/dashboards" - to = "/docs/user-guides/dashboards" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/features/events" - to = "/docs/user-guides/events" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/features/feature-flags" - to = "/docs/user-guides/feature-flags" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/features/funnels" - to = "/docs/user-guides/funnels" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/features/organizations" - to = "/docs/user-guides/organizations" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/features/paths" - to = "/docs/user-guides/paths" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/features/plugins" - to = "/docs/apps" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/features/projects" - to = "/docs/user-guides/projects" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/features/retention" - to = "/docs/user-guides/retention" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/features/session-recording" - to = "/docs/user-guides/session-recording" - -# Added: 2021-07-13 -# Edited: 2021-12-14 -[[redirects]] - from = "/docs/features/sessions" - to = "/blog/sessions-removal" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/features/toolbar" - to = "/docs/user-guides/toolbar" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/features/trends" - to = "/docs/user-guides/trends" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/features/users" - to = "/docs/user-guides/users" - -# Added: 2021-07-13 Updated: 2021-07-17 -[[redirects]] - from = "/docs/tutorials/overview" - to = "/docs/tutorials" - -# Added: 2021-07-13 Updated: 2021-07-17 -[[redirects]] - from = "/docs/features" - to = "/docs/user-guides" - -# Added: 2021-07-13 -[[redirects]] - from = "/docs/tutorials/1-minute/survey" - to = "/docs/tutorials/survey" - -# Added: 2021-07-14 -# Not due to a rename, but to improve the website's navigation experience -[[redirects]] - from = "/features" - to = "/product" - -# Added: 2021-07-16 Updated: 2021-07-17 -[[redirects]] - from = "/docs/integrate/overview" - to = "/docs/integrate" - -# Added: 2021-07-16 Updated: 2021-07-17 -[[redirects]] - from = "/docs/integrations" - to = "/docs/integrate" - -# Added: 2021-07-16 -[[redirects]] - from = "/docs/libraries" - to = "/docs/integrate" - -# Added: 2021-07-17 -# Not due to a rename, but to improve the website's navigation experience -[[redirects]] - from = "/signup" - to = "/pricing" - -# Added: 2021-07-28 -[[redirects]] - from = "/docs/self-host/deploy/render" - to = "/docs/self-host/deploy/other#render" - -# Added: 2021-07-28 -[[redirects]] - from = "/docs/self-host/deploy/qovery" - to = "/docs/self-host/deploy/other" - -# Added: 2021-07-30 -[[redirects]] - from = "/docs/tutorials/actions" - to = "/docs/tutorials/event-tracking-guide" - -# Added: 2021-07-17 -[[redirects]] - from = "/docs/plugins/overview" - to = "/docs/apps" - -# Added: 2021-07-17 -[[redirects]] - from = "/docs/api/overview" - to = "/docs/api" - -# Added: 2021-07-17 -[[redirects]] - from = "/docs/contribute/overview" - to = "/docs/contribute" - -# Added: 2021-07-17 -[[redirects]] - from = "/docs/user-guides/overview" - to = "/docs/user-guides" - -# Added: 2021-08-02 -[[redirects]] - from = "/docs/user-guides/log-in-with-sso" - to = "/docs/user-guides/sso" - -# Added: 2021-08-03 -[[redirects]] - from = "/docs/self-host/deploy/azure" - to = "/docs/self-host/deploy/other" - -# Added: 2021-08-03 -[[redirects]] - from = "/docs/self-host/deploy/docker" - to = "/docs/self-host/deploy/other" - -# Added: 2021-08-03 -[[redirects]] - from = "/docs/self-host/deploy/google-cloud-services" - to = "/docs/self-host/deploy/gcp" - -# Added: 2021-08-03 -[[redirects]] - from = "/docs/self-host/deploy/heroku" - to = "/docs/self-host/deploy/digital-ocean" - -# Added: 2021-08-03 -[[redirects]] - from = "/docs/self-host/deploy/kubernetes" - to = "/docs/self-host/deploy/other" - -# Added: 2021-08-03 -[[redirects]] - from = "/docs/self-host/deploy/source" - to = "/docs/self-host/deploy/other" - -# Added: 2021-08-03 -[[redirects]] - from = "/docs/self-host/deploy/proxy" - to = "/docs/cloud/proxy" - -# Added: 2021-08-12 -[[redirects]] - from = "/handbook/people/hiring-process/hiring-process" - to = "/handbook/people/hiring-process" - -# Added: 2021-08-12 -[[redirects]] - from = "/docs/integrate/client/ios/index" - to = "/docs/integrate/client/ios" - -# Added: 2021-08-05 -[[redirects]] - from = "/docs/integrate/client/js/index" - to = "/docs/integrate/client/js" - -# Added: 2021-08-12 -[[redirects]] - from = "/handbook/people/hiring-process/index" - to = "/handbook/people/hiring-process/hiring-process" - -# Added: 2021-08-12 -[[redirects]] - from = "/docs/self-host/deploy/overview" - to = "/docs/self-host" -# Added: 2021-08-19 -[[redirects]] - from = "/handbook/people/team-structure/growth-engineering" - to = "/handbook/people/team-structure/growth" - -# Added: 2021-09-09 -[[redirects]] - from = "/docs/user-guides/projects" - to = "/docs/user-guides/organizations-and-projects" - -# Added: 2021-09-09 -[[redirects]] - from = "/docs/user-guides/organizations" - to = "/docs/user-guides/organizations-and-projects" - -# Added: 2021-09-08; Updated: 2021-09-27 -[[redirects]] - from = "/handbook/engineering/enterprise-prioritization" - to = "/handbook/product/enterprise-features-prioritization" - -# Added: 2021-09-13 -[[redirects]] - from = "/blog/titles" - to = "/blog/startup-job-titles" - -# Added: 2021-09-14 -[[redirects]] - from = "/handbook/growth/marketing/Customer-personas" - to = "/handbook/growth/marketing/customer-personas" - -# Added: 2021-09-20 -[[redirects]] - from = "/handbook/engineering/product-team" - to = "/handbook/product/product-team" - -# Added: 2021-09-21 -[[redirects]] - from = "/blog/Building-the-future-of-game-analytics-pureskill" - to = "/blog/building-the-future-of-game-analytics-pureskill" - -# Added: 2021-09-27 -[[redirects]] - from = "/handbook/product/scale-features-prioritization" - to = "/handbook/product/enterprise-features-prioritization" - -# Added: 2021-09-27 -[[redirects]] - from = "/handbook/engineering/debugging" - to = "/handbook/engineering/production-access" - -# Added: 2021-10-6 -[[redirects]] - from = "/docs/user-guides/session-recording" - to = "/docs/user-guides/recordings" - -# Added: 2021-10-11 -[[redirects]] - from = "/blog/sessions-deprecation" - to = "/blog/sessions-removal" - -# Added: 2021-10-11 -[[redirects]] - from = "/docs/self-host/runbook/overview" - to = "/docs/self-host/runbook" - - -# Added: 2021-10-20 -[[redirects]] - from = "/blog/aarrr-how-to-build-pirate-funnel-posthog-with-posthog" - to = "/docs/tutorials/aarrr-how-to-build-pirate-funnel-posthog-with-posthog" - -# Manually Added: 2021-10-26 -[[redirects]] - from = "/docs/user-guides/users" - to = "/docs/user-guides/persons" - -# Manually Added: 2021-11-04 -[[redirects]] - from = "/docs/self-host/deploy/gke-clickhouse" - to = "/docs/self-host/deploy/gcp" - -# Manually Added: 2021-11-04 -[[redirects]] - from = "/docs/self-host/deploy/aws-clickhouse" - to = "/docs/self-host/deploy/aws" - -# Manually Added: 2021-11-04 -[[redirects]] - from = "/docs/integrations/api" - to = "/docs/api" - -# Manually Added: 2021-11-04 -[[redirects]] - from = "/docs/features/sso" - to = "/docs/user-guides/sso" - -# Manually Added: 2021-11-04 -[[redirects]] - from = "/docs/deployment/securing-posthog" - to = "/docs/self-host/configure/securing-posthog" - -# Manually Added: 2021-11-04 -[[redirects]] - from = "/docs/deployment/smtp-credentials" - to = "/docs/self-host/configure/email" - -# Manually Added: 2021-11-04 -[[redirects]] - from = "/docs/deployment/deploy-linode" - to = "/docs/self-host" - -# Manually Added: 2021-11-04 -[[redirects]] - from = "/request_demo" - to = "/schedule-demo" - -# Manually Added: 2021-11-04 -[[redirects]] - from = "/handbook/strategy/investor-updates" - to = "/handbook/strategy/investors" - -# Manually Added: 2021-11-04 -[[redirects]] - from = "/handbook/engineering/feature-parity" - to = "/handbook/strategy/overview" - -# Manually Added: 2021-11-04 -[[redirects]] - from = "/docs/contribute/updating-documentation" - to = "/docs/contribute" - -# Manually Added: 2021-11-04 -[[redirects]] - from = "/handbook/growth/marketing/messaging_framework" - to = "/handbook/growth/marketing" - -# Manually Added: 2021-11-04 -[[redirects]] - from = "/handbook/growth/handbook/engineering/support-hero" - to = "/handbook/growth/handbook/support-hero" - -# Manually Added: 2021-11-04 -[[redirects]] - from = "/handbook/people/handbook/people/hiring-process/marketing-hiring" - to = "/handbook/people/hiring-process/marketing-hiring" - -# Manually Added: 2021-11-04 -[[redirects]] - from = "/docs/plugins/maxmind" - to = "/apps" - -# Manually Added: 2021-11-04 -[[redirects]] - from = "/team" - to = "/handbook/company/team" - -# Manually Added: 2021-11-04 -[[redirects]] - from = "/contact" - to = "/signup/self-host/get-in-touch#contact" - -# Manually Added: 2021-11-04 -[[redirects]] - from = "/docs/integrate/third-party" - to = "/docs/integrate" - -# Manually Added: 2021-11-04 -[[redirects]] - from = "/docs/deployment/running-behind-proxy" - to = "/docs/self-host/configure/running-behind-proxy" - -# Manually Added: 2021-11-04 -[[redirects]] - from = "/docs/integrated" - to = "/docs/integrate" - -# Manually Added: 2021-11-04 -[[redirects]] - from = "/docs/scaling-posthog" - to = "/docs/self-host/deploy/configuration#scaling-up" - -# Manually Added: 2021-11-04 -[[redirects]] - from = "/handbook/growth/sales/" - to = "/handbook/growth/sales/overview" - -# Manually Added: 2021-11-04 -[[redirects]] - from = "/docs/api/api" - to = "/docs/api" - -# Manually Added: 2021-11-04 -[[redirects]] - from = "/docs/code-of-conduct" - to = "/docs/contribute/code-of-conduct" - -# Manually Added: 2021-11-04 -[[redirects]] - from = "/docs/self-host/docs/self-host/postgres-vs-clickhouse" - to = "/docs/self-host/postgres-vs-clickhouse" - -# Manually Added: 2021-11-10 -[[redirects]] - from = "/blog/the-posthog-array-1-29-1" - to = "/blog/the-posthog-array-1-29-0" - -# Manually Added: 2021-11-10 -[[redirects]] - from = "/blog/the-posthog-array-1-28-1" - to = "/blog/the-posthog-array-1-28-0" - -# Manually Added: 2021-11-10 -[[redirects]] - from = "/blog/the-posthog-array-1-23-1" - to = "/blog/the-posthog-array-1-23-0" - -# Manually Added: 2021-11-10 -[[redirects]] - from = "/blog/the-posthog-array-1-15-1" - to = "/blog/the-posthog-array-1-15-0" - -# Added: 2021-11-10 -[[redirects]] - from = "/handbook/people/team-structure/design" - to = "/handbook/design/philosophy" - -# Added: 2021-11-11 -[[redirects]] - from = "/handbook/design/about-design" - to = "/handbook/design/philosophy" - -[[redirects]] - from = "/product-features/self-hosted" - to = "/product" - -[[redirects]] - from = "/product-features/event-autocapture" - to = "/product" - -[[redirects]] - from = "/product-features/trends" - to = "/product/trends" - -[[redirects]] - from = "/product-features/funnels" - to = "/apps/funnels" - -[[redirects]] - from = "/product-features/retention" - to = "/product" - -[[redirects]] - from = "/product-features/feature-flags" - to = "/apps/feature-flags" - -[[redirects]] - from = "/product-features/session-recording" - to = "/apps/session-recording" - -[[redirects]] - from = "/product-features/plugins" - to = "/apps" - status = 301 - -[[redirects]] - from = "/heatmaps" - to = "/apps/heatmaps" - - -# Added: 2021-12-09 -[[redirects]] - from = "/docs/tutorials/aarrr-framework" - to = "/tutorials/aarrr-framework" - - -# Added: 2021-12-09 -[[redirects]] - from = "/docs/tutorials/aarrr-how-to-build-pirate-funnel-posthog-with-posthog" - to = "/tutorials/aarrr-how-to-build-pirate-funnel-posthog-with-posthog" - - -# Added: 2021-12-09 -[[redirects]] - from = "/docs/tutorials/b2b" - to = "/tutorials/b2b" - - -# Added: 2021-12-09 -[[redirects]] - from = "/docs/tutorials/cohorts" - to = "/tutorials/cohorts" - - -# Added: 2021-12-09 -[[redirects]] - from = "/docs/tutorials/deleting-data" - to = "/tutorials/deleting-data" - - -# Added: 2021-12-09 -[[redirects]] - from = "/docs/tutorials/event-tracking-guide" - to = "/tutorials/event-tracking-guide" - - -# Added: 2021-12-09 -[[redirects]] - from = "/docs/tutorials/feature-flags" - to = "/tutorials/feature-flags" - - -# Added: 2021-12-09 -[[redirects]] - from = "/docs/tutorials/funnels" - to = "/tutorials/funnels" - - -# Added: 2021-12-09 -[[redirects]] - from = "/docs/tutorials/how-to-embed-shared-dashboard" - to = "/tutorials/how-to-embed-shared-dashboard" - - -# Added: 2021-12-09 -[[redirects]] - from = "/docs/tutorials/nextjs-supabase-signup-funnel" - to = "/tutorials/nextjs-supabase-signup-funnel" - - -# Added: 2021-12-09 -[[redirects]] - from = "/docs/tutorials/retention" - to = "/tutorials/retention" - - -# Added: 2021-12-09 -[[redirects]] - from = "/docs/tutorials/revenue" - to = "/tutorials/revenue" - - -# Added: 2021-12-09 -[[redirects]] - from = "/docs/tutorials/spa" - to = "/tutorials/spa" - - -# Added: 2021-12-09 -[[redirects]] - from = "/docs/tutorials/survey" - to = "/tutorials/survey" - - -# Added: 2021-12-09 -[[redirects]] - from = "/docs/tutorials/taxonomy-acquisition" - to = "/tutorials/taxonomy-acquisition" - - -# Added: 2021-12-09 -[[redirects]] - from = "/docs/tutorials/toolbar" - to = "/tutorials/toolbar" - - -# Added: 2021-12-09 -[[redirects]] - from = "/docs/tutorials/tracking-teams" - to = "/tutorials/tracking-teams" - -# Added: 2021-12-03 -[[redirects]] - from = "/handbook/company/branding" - to = "/handbook/company/brand-assets" - -[[redirects]] - from = "/docs/tutorials/*" - to = "/tutorials/:splat" - -# Added: 2021-12-08 -[[redirects]] - from = "/docs/self-host/hobby-deployment" - to = "/docs/self-host/deploy/hobby" - -# Added: 2021-12-13 -[[redirects]] - from = "/handbook/engineering/ee-setup" - to = "/docs/contribute/developing-locally" - -# Added: 2022-01-10 -[[redirects]] - from = "/docs/tutorials/how-to-segment-users" - to = "/tutorials/how-to-segment-users" - -[build] - command = "GATSBY_DEPLOY_PRIME_URL=$DEPLOY_PRIME_URL GATSBY_CONTEXT=$CONTEXT gatsby build" - -# Added: 2022-02-04 -[[redirects]] - from = "/docs/self-host/runbook/clickhouse/vertical_scaling" - to = "/docs/self-host/runbook/clickhouse/vertical-scaling" - -# Added: 2022-02-17 -[[redirects]] - from = "/docs/privacy/overview" - to = "/docs/privacy" - -[[redirects]] - from = "/docs/integrate/gdpr" - to = "/docs/privacy/gdpr-compliance" - - -# Added: 2022-02-21 -[[redirects]] - from = "/blog/hipaa-compliant-analytics" - to = "/blog/best-hipaa-compliant-analytics-tools" - - -# Added: 2022-03-03 -[[redirects]] - from = "/handbook/engineering/databases/async-migrations" - to = "/handbook/engineering/async-migrations" - -# Added: 2022-03-03 -[[redirects]] - from = "/handbook/engineering/databases/event-ingestion" - to = "/handbook/engineering/event-ingestion" - - -# Added: 2022-03-03 -[[redirects]] - from = "/handbook/engineering/databases/query-performance-optimization" - to = "/handbook/engineering/query-performance-optimization" - -# Added: 2022-03-03 -[[redirects]] - from = "/handbook/engineering/databases/schema-changes" - to = "/handbook/engineering/schema-changes" - - -# Added: 2022-03-10 -[[redirects]] - from = "/handbook/engineering/aws" - to = "/handbook/engineering/cloud-providers" - - -# Added: 2022-03-10 -[[redirects]] - from = "/docs/contribute/coding-conventions" - to = "/handbook/engineering/conventions/frontend-coding" - - -# Added: 2022-03-10 -[[redirects]] - from = "/docs/contribute/developing-locally" - to = "/handbook/engineering/developing-locally" - - -# Added: 2022-03-10 -[[redirects]] - from = "/handbook/engineering/mdx" - to = "/handbook/engineering/posthog-com/mdx-setup" - - -# Added: 2022-03-10 -[[redirects]] - from = "/docs/contribute/project-structure" - to = "/handbook/engineering/project-structure" - - -# Added: 2022-03-10 -[[redirects]] - from = "/docs/contribute/stack" - to = "/handbook/engineering/stack" - -# Added: 2022-03-10 -[[redirects]] - from = "/tutorials/categories/session-recordings" - to = "/tutorials/categories/session-recording" - - -# Added: 2022-03-14 -[[redirects]] - from = "/docs/contribute/contribute-to-website" - to = "/handbook/engineering/posthog-com/developing-the-website" - - -# Added: 2022-03-16 -[[redirects]] - from = "/sso" - to = "/docs/user-guides/sso" - -# Added: 2022-03-16 -[[redirects]] - from = "/docs/api/people" - to = "/docs/api/persons" - -# Added: 2022-03-25 -[[redirects]] - from = "/handbook/engineering/k8s-overview" - to = "/docs/self-host/architecture" - -# Added: 2022-04-01 -[[redirects]] - from = "/product/user-paths" - to = "/apps/user-paths" - -# Added: 2022-04-07 -[[redirects]] - from = "/tutorials/free-hotjar-alternative" - to = "/blog/best-open-source-session-replay-tools" - -# Added: 2022-05-03 -[[redirects]] - from = "/docs/privacy/hipaa-compliance" - to = "/blog/hipaa-compliant-analytics" - - -# Added: 2022-05-03 -[[redirects]] - from = "/handbook/engineering/conventions/frontend-coding" - to = "/docs/contribute/coding-conventions" - - -# Added: 2022-05-03 -[[redirects]] - from = "/handbook/engineering/posthog-com/developing-the-website" - to = "/docs/contribute/contribute-to-website" - - -# Added: 2022-05-03 -[[redirects]] - from = "/handbook/engineering/developing-locally" - to = "/docs/contribute/developing-locally" - - -# Added: 2022-05-03 -[[redirects]] - from = "/handbook/engineering/project-structure" - to = "/docs/contribute/project-structure" - - -# Added: 2022-05-03 -[[redirects]] - from = "/handbook/engineering/stack" - to = "/docs/contribute/stack" - - -# Added: 2022-05-03 -[[redirects]] - from = "/handbook/engineering/cloud-providers" - to = "/handbook/engineering/aws" - - -# Added: 2022-05-03 -[[redirects]] - from = "/handbook/engineering/posthog-com/mdx-setup" - to = "/handbook/engineering/mdx" - -# Added: 2022-05-03 -[[redirects]] - from = "/product/quantitative-analysis" - to = "/product/correlation-analysis" - -# Added: 2022-05-12 -[[redirects]] - from = "/docs/plugins/build/reference" - to = "/docs/apps/build/reference" - -# Added: 2022-05-12 -[[redirects]] - from = "/docs/plugins/build/types" - to = "/docs/apps/build/types" - -# Added: 2022-05-12 -[[redirects]] - from = "/docs/plugins/enabling" - to = "/docs/apps/enabling" - -# Added: 2022-05-13 -[[redirects]] - from = "/docs/plugins" - to = "/docs/apps" - -# Added: 2022-05-13 -[[redirects]] - from = "/integrations" - to = "/apps" - -# Added: 2022-05-13 -[[redirects]] - from = "/integrations/*" - to = "/apps/:splat" - -# Added: 2022-05-13 -[[redirects]] - from = "/docs/user-guides/plugins" - to = "/docs/apps" - -# Added: 2022-05-12 -[[redirects]] - from = "/product-features" - to = "/blog/posthog-vs-amplitude" - -# Added: 2022-05-26 -[[redirects]] - from = "/support" - to = "/questions" - -# Added: 2022-05-27 -[[redirects]] - from = "/customers/why-i-ditched-mixpanel-for-posthog" - to = "/blog/why-i-ditched-google-analytics-for-posthog" - -# Added: 2022-05-30 -[[redirects]] - from = "/handbook/company/1-1s" - to = "/handbook/company/management" - -# Added: 2022-06-07 -[[redirects]] - from = "/lenny" - to = "/?utm_campaign=lenny" - -# Added: 2022-06-09 -[[redirects]] - from = "/blog/the-posthog-array-1-36-1" - to = "/blog/the-posthog-array-1-36-0" - -# Added: 2022-06-16 -[[redirects]] - from = "/tutorials/b2b" - to = "/blog/b2b-saas-product-metrics" - -# Added: 2022-06-28 -[[redirects]] - from = "/docs/self-host/migrate-to-cloud" - to = "/docs/self-host/migrate/migrate-between-cloud-and-self-hosted" - -# Added: 2022-06-30 -[[redirects]] - from = "/tutorials/categories/plugins" - to = "/tutorials/categories/apps" - -# Added: 2022-07-08 -[[redirects]] - from = "/startups" - to = "/pricing" - -# Added: 2022-07-11 -[[redirects]] - from = "/trial" - to = "/pricing" - -# Added: 2022-07-12 -[[redirects]] - from = "/schedule-demo" - to = "/book-a-demo" - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/airbyte-export/docs" - to = "/docs/apps/airbyte-export" - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/amazon-kinesis/docs" - to = "/docs/apps/amazon-kinesis" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/automatic-cohort-creator/docs" - to = "/docs/apps/automatic-cohort-creator" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/bigquery-export/docs" - to = "/docs/apps/bigquery-export" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/bitbucket-release-tracker/docs" - to = "/docs/apps/bitbucket-release-tracker" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/braze/docs" - to = "/docs/apps/braze" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/currency-normalization/docs" - to = "/docs/apps/currency-normalization" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/customer-io/docs" - to = "/docs/apps/customer-io" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/databricks/docs" - to = "/docs/apps/databricks" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/downsampling/docs" - to = "/docs/apps/downsampling" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/email-scoring/docs" - to = "/docs/apps/email-scoring" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/engage-connector/docs" - to = "/docs/apps/engage-connector" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/event-sequence-timer/docs" - to = "/docs/apps/event-sequence-timer" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/first-time-event-tracker/docs" - to = "/docs/apps/first-time-event-tracker" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/geoip-enrichment/docs" - to = "/docs/apps/geoip-enrichment" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/github-release-tracker/docs" - to = "/docs/apps/github-release-tracker" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/github-star-sync/docs" - to = "/docs/apps/github-star-sync" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/gitlab-release-tracker/docs" - to = "/docs/apps/gitlab-release-tracker" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/google-cloud-export/docs" - to = "/docs/apps/google-cloud-export" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/google-pub-sub-connector/docs" - to = "/docs/apps/google-pub-sub-connector" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/heartbeat/docs" - to = "/docs/apps/heartbeat" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/hubspot-connector/docs" - to = "/docs/apps/hubspot-connector" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/ingestion-alert/docs" - to = "/docs/apps/ingestion-alert" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/intercom/docs" - to = "/docs/apps/intercom" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/migrator-3000/docs" - to = "/docs/apps/migrator-3000" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/n8n/docs" - to = "/docs/apps/n8n" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/orbit/docs" - to = "/docs/apps/orbit" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/pagerduty-connector/docs" - to = "/docs/apps/pagerduty-connector" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/postgres-export/docs" - to = "/docs/apps/postgres-export" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/property-filter/docs" - to = "/docs/apps/property-filter" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/property-flattener/docs" - to = "/docs/apps/property-flattener" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/redshift-export/docs" - to = "/docs/apps/redshift-export" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/redshift-import/docs" - to = "/docs/apps/redshift-import" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/replicator/docs" - to = "/docs/apps/replicator" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/rudderstack-export/docs" - to = "/docs/apps/rudderstack-export" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/s3-export/docs" - to = "/docs/apps/s3-export" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/salesforce-connector/docs" - to = "/docs/apps/salesforce-connector" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/schema-enforcer/docs" - to = "/docs/apps/schema-enforcer" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/segment/docs" - to = "/docs/apps/segment" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/sendgrid-connector/docs" - to = "/docs/apps/sendgrid-connector" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/sentry-connector/docs" - to = "/docs/apps/sentry-connector" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/shopify/docs" - to = "/docs/apps/shopify" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/snowflake-export/docs" - to = "/docs/apps/snowflake-export" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/taxonomy-standardizer/docs" - to = "/docs/apps/taxonomy-standardizer" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/timestamp-parser/docs" - to = "/docs/apps/timestamp-parser" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/twilio/docs" - to = "/docs/apps/twilio" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/twitter-followers/docs" - to = "/docs/apps/twitter-followers" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/unduplicator/docs" - to = "/docs/apps/unduplicator" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/url-normalizer/docs" - to = "/docs/apps/url-normalizer" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/user-agent-populator/docs" - to = "/docs/apps/user-agent-populator" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/variance-connector/docs" - to = "/docs/apps/variance-connector" - - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/zapier-connector/docs" - to = "/docs/apps/zapier-connector" - -# Added: 2022-07-14 -[[redirects]] - from = "/apps/zendesk-connector/docs" - to = "/docs/apps/zendesk-connector" - -# Added: 2022-07-18 -[[redirects]] - from = "/blog/the-posthog-array-1-37-1" - to = "/blog/the-posthog-array-1-37-0" - -[[redirects]] - from = "/handbook/engineering/app-west" - to = "/handbook/small-teams/experimentation" - -[[redirects]] - from = "/docs/self-host/configure/async-migrations" - to = "/docs/runbook/async-migrations" - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/configure/async-migrations/0001-events-sample-by" - to = "/docs/runbook/async-migrations/0001-events-sample-by" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/configure/async-migrations/0002-events-sample-by" - to = "/docs/runbook/async-migrations/0002-events-sample-by" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/configure/async-migrations/0003-fill-person-distinct-id2" - to = "/docs/runbook/async-migrations/0003-fill-person-distinct-id2" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/configure/async-migrations/overview" - to = "/docs/runbook/async-migrations" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/disaster-recovery" - to = "/docs/runbook/disaster-recovery" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/runbook/clickhouse/backup" - to = "/docs/runbook/services/clickhouse/backup" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/runbook/clickhouse" - to = "/docs/runbook/services/clickhouse" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/runbook/clickhouse/kafka-engine" - to = "/docs/runbook/services/clickhouse/kafka-engine" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/runbook/clickhouse/resize-disk" - to = "/docs/runbook/services/clickhouse/resize-disk" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/runbook/clickhouse/restore" - to = "/docs/runbook/services/clickhouse/restore" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/runbook/clickhouse/sharding-and-replication" - to = "/docs/runbook/services/clickhouse/sharding-and-replication" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/runbook/clickhouse/vertical-scaling" - to = "/docs/runbook/services/clickhouse/vertical-scaling" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/runbook/kafka" - to = "/docs/runbook/services/kafka" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/runbook/kafka/log-retention" - to = "/docs/runbook/services/kafka/log-retention" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/runbook/kafka/resize-disk" - to = "/docs/runbook/services/kafka/resize-disk" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/runbook/minio" - to = "/docs/runbook/services/minio" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/runbook/plugin-server/diagrams/async-server" - to = "/docs/runbook/services/plugin-server/diagrams/async-server" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/runbook/plugin-server/diagrams/event-flow" - to = "/docs/runbook/services/plugin-server/diagrams/event-flow" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/runbook/plugin-server/diagrams/ingestion-server" - to = "/docs/runbook/services/plugin-server/diagrams/ingestion-server" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/runbook/plugin-server/diagrams/plugin-server" - to = "/docs/runbook/services/plugin-server/diagrams/plugin-server" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/runbook/plugin-server" - to = "/docs/runbook/services/plugin-server" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/runbook/postgresql" - to = "/docs/runbook/services/postgresql" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/postgres-upgrade-migrations" - to = "/docs/runbook/services/postgresql/long-migrations" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/runbook/postgresql/resize-disk" - to = "/docs/runbook/services/postgresql/resize-disk" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/runbook/redis" - to = "/docs/runbook/services/redis" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/runbook/zookeeper" - to = "/docs/runbook/services/zookeeper" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/deploy/upgrade-notes" - to = "/docs/runbook/upgrade-notes" - - -# Added: 2022-08-02 -[[redirects]] - from = "/docs/self-host/configure/upgrading-posthog" - to = "/docs/runbook/upgrading-posthog" - - -# Added: 2022-08-03 -[[redirects]] - from = "/tutorials/aarrr-framework" - to = "/blog/aarrr-pirate-funnel" - -[[redirects]] - from = "/tutorials/aarrr-how-to-build-pirate-funnel-posthog-with-posthog" - to = "/blog/aarrr-pirate-funnel" - -# Added: 2022-08-08 -[[redirects]] - from = "/docs/cloud/proxy" - to = "/docs/integrate/proxy" - -# Added: 2022-08-08 -[[redirects]] - from = "/docs/self-host/migrate/migrate-between-cloud-and-self-hosted" - to = "/docs/migrate/migrate-between-cloud-and-self-hosted" - -# Added: 2022-08-08 -[[redirects]] - from = "/docs/self-host/migrate/migrate-from-amplitude" - to = "/docs/migrate/migrate-from-amplitude" - -# Added: 2022-02-03 -[[redirects]] - from = "/docs/self-host/migrate-from-postgres-to-clickhouse" - to = "/docs/migrate/migrate-to-another-self-hosted-instance" - -# Added: 2022-08-08 -[[redirects]] - from = "/docs/self-host/migrate/migrate-to-another-self-hosted-instance" - to = "/docs/migrate/migrate-to-another-self-hosted-instance" - -# Added: 2022-08-10 -[[redirects]] - from = "/handbook/product/pm-rampup" - to = "/handbook/people/ramp-up/product-manager" - -[[redirects]] - from = "/handbook/small-teams/team-structure/why-small-teams" - to = "/handbook/people/team-structure/why-small-teams" - -[[redirects]] - from = "/docs/plugins/build" - to = "/docs/apps/build" - -# Added: 2022-08-24 -[[redirects]] - from = "/docs/data-model" - to = "/docs/how-posthog-works/data-model" - force = true - -# Added: 2022-08-25 -[[redirects]] - from = "/docs/self-host/architecture" - to = "/docs/how-posthog-works" - -# Added: 2022-08-25 -[[redirects]] - from = "/handbook/engineering/databases" - to = "/docs/how-posthog-works/ingestion-pipeline" - -# Added: 2022-09-15 -[[redirects]] - from = "/handbook/people/team-structure/team-east" - to = "/handbook/people/team-structure/product-analytics" - - -[[redirects]] - from = "/marketplace" - to = "/partners" - - -# Added: 2022-10-01 -[[redirects]] - from = "/marketplace/guidelines" - to = "/partners/guidelines" - - -# Added: 2022-10-01 -[[redirects]] - from = "/marketplace/listing-template" - to = "/partners/listing-template" - - -# Added: 2022-09-24 -[[redirects]] - from = "/handbook/company/working-with-product-design" - to = "/handbook/engineering/product-design" - -# Added: 2022-09-16 -[[redirects]] - from = "/handbook/strategy/overview" - to = "/handbook/strategy/strategy" - -# Added: 2022-08-29 -[[redirects]] - from = "/docs/architecture/ingestion-pipeline" - to = "/docs/how-posthog-works/ingestion-pipeline" - -# Added: 2022-09-01 -[[redirects]] - from = "/blog/the-posthog-array-1-39-1" - to = "/blog/the-posthog-array-1-39-0" - -# Added: 2022-09-02 -[[redirects]] - from = "/product/experimentation" - to = "/product/experimentation-suite" - -# Added: 2022-09-11 # Updated: 2022-09-15 -[[redirects]] - from = "/handbook/strategy/strategy" - to = "/handbook/strategy/overview" - -# Added: 2022-09-15 -[[redirects]] - from = "/handbook/engineering/app-east" - to = "/handbook/people/team-structure/product-analytics" - -[[redirects]] - from = "/handbook/people/team-structure/app-east" - to = "/handbook/small-teams/app-east" - -# Added: 2022-09-20 -[[redirects]] - from = "/docs/integrate/client/browser-extension" - to = "/docs/integrate/browser-extension" - -# Added: 2022-09-24 -[[redirects]] - from = "/handbook/company/website-design-process" - to = "/handbook/designing-posthog-website" - -# Added: 2022-10-01 -[[redirects]] - from = "/handbook/people/team-structure" - to = "/handbook/small-teams" - -# Added: 2022-10-01 -[[redirects]] - from = "/handbook/people/team-structure/why-small-teams" - to = "/handbook/company/small-teams" - -[[redirects]] - from = "/handbook/people/team-structure/app-west" - to = "/handbook/small-teams/experimentation" - -[[redirects]] - from = "/handbook/people/team-structure/customer-success" - to = "/handbook/small-teams/customer-success" - -[[redirects]] - from = "/handbook/people/team-structure/exec" - to = "/handbook/small-teams/exec" - -[[redirects]] - from = "/handbook/people/team-structure/growth" - to = "/handbook/small-teams/growth" - -[[redirects]] - from = "/handbook/people/team-structure/infrastructure" - to = "/handbook/small-teams/infrastructure" - -[[redirects]] - from = "/handbook/people/team-structure/ingestion" - to = "/handbook/small-teams/ingestion" - -[[redirects]] - from = "/handbook/people/team-structure/marketing" - to = "/handbook/small-teams/marketing" - -[[redirects]] - from = "/handbook/people/team-structure/people" - to = "/handbook/small-teams/people" - -[[redirects]] - from = "/handbook/people/team-structure/platform" - to = "/handbook/small-teams/platform" - -[[redirects]] - from = "/handbook/people/team-structure/session-recording" - to = "/handbook/small-teams/session-recording" - -[[redirects]] - from = "/handbook/people/team-structure/website-docs" - to = "/handbook/small-teams/website-docs" - - -# Added: 2022-10-01 -[[redirects]] - from = "/handbook/people/team-structure/_team_template" - to = "/handbook/small-teams/_team_template" - -# Added: 2022-10-01 -[[redirects]] - from = "/marketplace/clickhouse" - to = "/partners/clickhouse" - - -# Added: 2022-10-01 -[[redirects]] - from = "/marketplace/opsverse" - to = "/partners/opsverse" - - -# Added: 2022-10-01 -[[redirects]] - from = "/marketplace/restack" - to = "/partners/restack" - -# Added: 2022-10-01 -[[redirects]] - from = "/marketplace/altinity" - to = "/partners/altinity" - - -# Added: 2022-10-11 -[[redirects]] - from = "/handbook/people/team-structure/experimentation" - to = "/handbook/small-teams/experimentation" - - -# Added: 2022-10-11 -[[redirects]] - from = "/handbook/people/team-structure/pipeline" - to = "/handbook/small-teams/pipeline" - -# Added: 2022-10-11 -[[redirects]] - from = "/handbook/people/team-structure/product-analytics" - to = "/handbook/small-teams/product-analytics" - -# Added: 2022-10-07 -[[redirects]] - from = "/docs/self-host/postgres-vs-clickhouse" - to = "/blog/clickhouse-vs-postgres" - -# Added: 2022-10-11 -[[redirects]] - from = "/handbook/people/team-structure/team-structure" - to = "/handbook/small-teams/team-structure" - -[[redirects]] - from = "/eu-cloud" - to = "/eu" - -[[redirects]] - from = "/partners/restack" - to = "/marketplace/restack" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/_team_template" - to = "/handbook/people/team-structure/_team_template" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/customer-success" - to = "/handbook/people/team-structure/customer-success" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/customer-success/mission" - to = "/handbook/people/team-structure/customer-success/mission" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/customer-success/objectives" - to = "/handbook/people/team-structure/customer-success/objectives" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/exec" - to = "/handbook/people/team-structure/exec" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/exec/mission" - to = "/handbook/people/team-structure/exec/mission" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/exec/objectives" - to = "/handbook/people/team-structure/exec/objectives" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/product-analytics/mission" - to = "/handbook/people/team-structure/experimentation/mission" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/infrastructure" - to = "/handbook/people/team-structure/infrastructure" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/infrastructure/mission" - to = "/handbook/people/team-structure/infrastructure/mission" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/infrastructure/objectives" - to = "/handbook/people/team-structure/infrastructure/objectives" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/marketing" - to = "/handbook/people/team-structure/marketing" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/marketing/mission" - to = "/handbook/people/team-structure/marketing/mission" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/marketing/objectives" - to = "/handbook/people/team-structure/marketing/objectives" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/people" - to = "/handbook/people/team-structure/people" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/people/mission" - to = "/handbook/people/team-structure/people/mission" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/people/objectives" - to = "/handbook/people/team-structure/people/objectives" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/pipeline" - to = "/handbook/people/team-structure/pipeline" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/pipeline/objectives" - to = "/handbook/people/team-structure/pipeline/objectives" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/product-analytics" - to = "/handbook/people/team-structure/product-analytics" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/experimentation/mission" - to = "/handbook/people/team-structure/product-analytics/mission" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/product-analytics/objectives" - to = "/handbook/people/team-structure/product-analytics/objectives" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/session-recording" - to = "/handbook/people/team-structure/session-recording" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/session-recording/objectives" - to = "/handbook/people/team-structure/session-recording/objectives" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/team-structure" - to = "/handbook/people/team-structure/team-structure" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/website-docs" - to = "/handbook/people/team-structure/website-docs" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/website-docs/mission" - to = "/handbook/people/team-structure/website-docs/mission" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/website-docs/objectives" - to = "/handbook/people/team-structure/website-docs/objectives" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/company/small-teams" - to = "/handbook/people/team-structure/why-small-teams" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/strategy/roadmap" - to = "/roadmap" - - -# Added: 2022-11-09 -[[redirects]] - from = "/handbook/engineering/production-access" - to = "/handbook/engineering/how-to-access-posthog-cloud-infra" - -# Added: 2022-11-10 -[[redirects]] - from = "/handbook/engineering/clickhouse/schema/overview" - to = "/handbook/engineering/clickhouse/schema" - - -# Added: 2022-11-11 -[[redirects]] - from = "/docs/self-host/deploy/hosting-costs" - to = "/docs/self-host/enterprise/hosting-costs" - - -# Added: 2022-11-11 -[[redirects]] - from = "/docs/self-host/deploy/hobby" - to = "/docs/self-host/open-source/deployment" - - -# Added: 2022-11-11 -[[redirects]] - from = "/docs/self-host/deploy/support" - to = "/docs/self-host/open-source/support" - -# Added: 2022-11-15 -[[redirects]] - from = "/docs/self-host/open-source/deployment" - to = "/docs/self-host/deploy/hobby" - - -# Added: 2022-11-15 -[[redirects]] - from = "/docs/self-host/enterprise/hosting-costs" - to = "/docs/self-host/deploy/hosting-costs" - - -# Added: 2022-11-15 -[[redirects]] - from = "/handbook/people/team-structure/app-west/mission" - to = "/handbook/people/team-structure/product-analytics/mission" - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/_team_template" - to = "/handbook/people/team-structure/_team_template" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/customer-success" - to = "/handbook/people/team-structure/customer-success" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/customer-success/mission" - to = "/handbook/people/team-structure/customer-success/mission" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/customer-success/objectives" - to = "/handbook/people/team-structure/customer-success/objectives" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/exec" - to = "/handbook/people/team-structure/exec" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/exec/mission" - to = "/handbook/people/team-structure/exec/mission" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/exec/objectives" - to = "/handbook/people/team-structure/exec/objectives" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/product-analytics/mission" - to = "/handbook/people/team-structure/experimentation/mission" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/infrastructure" - to = "/handbook/people/team-structure/infrastructure" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/infrastructure/mission" - to = "/handbook/people/team-structure/infrastructure/mission" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/infrastructure/objectives" - to = "/handbook/people/team-structure/infrastructure/objectives" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/marketing" - to = "/handbook/people/team-structure/marketing" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/marketing/mission" - to = "/handbook/people/team-structure/marketing/mission" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/marketing/objectives" - to = "/handbook/people/team-structure/marketing/objectives" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/people" - to = "/handbook/people/team-structure/people" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/people/mission" - to = "/handbook/people/team-structure/people/mission" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/people/objectives" - to = "/handbook/people/team-structure/people/objectives" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/pipeline" - to = "/handbook/people/team-structure/pipeline" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/pipeline/objectives" - to = "/handbook/people/team-structure/pipeline/objectives" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/product-analytics" - to = "/handbook/people/team-structure/product-analytics" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/experimentation/mission" - to = "/handbook/people/team-structure/product-analytics/mission" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/product-analytics/objectives" - to = "/handbook/people/team-structure/product-analytics/objectives" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/session-recording" - to = "/handbook/people/team-structure/session-recording" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/team-structure" - to = "/handbook/people/team-structure/team-structure" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/website-docs" - to = "/handbook/people/team-structure/website-docs" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/website-docs/mission" - to = "/handbook/people/team-structure/website-docs/mission" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/small-teams/website-docs/objectives" - to = "/handbook/people/team-structure/website-docs/objectives" - - -# Added: 2022-10-27 -[[redirects]] - from = "/handbook/company/small-teams" - to = "/handbook/people/team-structure/why-small-teams" - - -# Added: 2022-10-27 -[[redirects]] - from = "/partners/altinity" - to = "/marketplace/altinity" - - -# Added: 2022-10-27 -[[redirects]] - from = "/partners/clickhouse" - to = "/marketplace/clickhouse" - - -# Added: 2022-10-27 -[[redirects]] - from = "/partners/guidelines" - to = "/marketplace/guidelines" - - -# Added: 2022-10-27 -[[redirects]] - from = "/partners" - to = "/marketplace" - - -# Added: 2022-10-27 -[[redirects]] - from = "/partners/listing-template" - to = "/marketplace/listing-template" - - -# Added: 2022-10-27 -[[redirects]] - from = "/partners/opsverse" - to = "/marketplace/opsverse" - - -# Added: 2022-10-27 -[[redirects]] - from = "/partners/restack" - to = "/marketplace/restack" - -# Added: 2022-10-27 -[[redirects]] - from = "/docs/self-host/open-source/support" - to = "/docs/self-host/deploy/support" - -# Added: 2022-12-12 -[[redirects]] - from = "/blog/using-posting" - to = "/blog/using-posthog" - - -# Added: 2023-01-09 -[[redirects]] - from = "/docs/integrate/client/snippet-installation" - to = "/docs/integrate/_snippets/snippet" diff --git a/package.json b/package.json index 6f46bddee..b0e6b0044 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "test": "echo \"Error: no test specified\" && exit 1", "typegen": "kea-typegen write .", "update-sprite": "svg-sprite -s --symbol-dest src/components/productFeature/images/icons --symbol-sprite sprited-icons.svg src/components/productFeature/images/icons/*.svg", - "generate-redirects": "git diff origin/master $(git branch --show-current) > pr_diff && DEBUG=true RUN_AS_SCRIPT=true node ./scripts/safe_rename.js", "test-redirects": "jest scripts", "storybook": "start-storybook -s ./static -p 6006", "build-storybook": "build-storybook" diff --git a/scripts/safe_rename.js b/scripts/safe_rename.js deleted file mode 100644 index 5b8976002..000000000 --- a/scripts/safe_rename.js +++ /dev/null @@ -1,147 +0,0 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ -const fs = require('fs') -const fetch = require('node-fetch') - -let DEBUG = false - -const log = (...args) => { - if (DEBUG) { - console.log.apply(null, args) - } -} - -/** Return date (without time) in ISO format. */ -const formatDate = (date) => { - return date.toISOString().slice(0, 10) -} - -const redirectText = (from, to) => { - return ` -[[redirects]] - from = "${from}" - to = "${to}" -` -} - -const redirectWithDateCommentText = (date, redirect) => { - return ` - -# Added: ${formatDate(date)}${redirect}` -} - -// Rules -const samePath = ({ fromPath, toPath }) => { - return fromPath === toPath -} - -const mdToMdx = ({ fromPath, toPath }) => { - // # old rule - // # return '.mdx' not in from_paths[i] and '.mdx' in to_paths[i] - return fromPath.endsWith('.md') && toPath.endsWith('.mdx') -} - -const redirectExists = ({ redirect, localConfig, remoteConfig }) => { - return localConfig.indexOf(redirect.trim()) !== -1 || remoteConfig.indexOf(redirect.trim()) !== -1 -} - -const fromDotStar = ({ fromPath }) => { - return fromPath == '(.*)' -} - -const isSnippetsRename = ({ fromPath, toPath }) => { - return fromPath.indexOf('/snippets/') !== -1 || toPath.indexOf('/snippets') !== -1 -} - -const skipRules = { - samePath, - mdToMdx, - redirectExists, - fromDotStar, - isSnippetsRename, -} - -// # Load existing remote redirect config -const getRemoteConfig = async () => { - const response = await fetch('https://raw.githubusercontent.com/PostHog/posthog.com/master/netlify.toml') - return await response.text() -} - -// # Load existing redirect file to be used to avoid duplicates -const getLocalConfig = async () => { - return await fs.promises.readFile('./netlify.toml', 'utf8') -} - -const appendToLocalConfig = async (newRedirects) => { - await fs.promises.appendFile('./netlify.toml', newRedirects) -} - -const getRedirects = async ({ gitDiff, localConfig, remoteConfig, debug = false }) => { - DEBUG = debug - log(gitDiff) - - const renameFromRegex = new RegExp('rename from contents(.*).md', 'g') - const renameToRegex = new RegExp('rename to contents(.*).md', 'g') - - const fromPaths = Array.from(gitDiff.matchAll(renameFromRegex), (m) => m[1]) - const toPaths = Array.from(gitDiff.matchAll(renameToRegex), (m) => m[1]) - - log(fromPaths, toPaths) - - const newRedirects = [] - if (fromPaths.length > 0 && fromPaths.length === toPaths.length) { - for (let i = 0; i < fromPaths.length; ++i) { - // handle index default directory files. /path/index will become /path - const fromPath = fromPaths[i].replace(/\/index$/, '', fromPaths[i]) - const toPath = toPaths[i].replace(/\/index$/, '', toPaths[i]) - - const redirect = redirectText(fromPath, toPath) - // console.log(redirect) - - log(`Testing if redirects are required for: "${fromPath}" to "${toPath}"`) - - let skipRedirect = false - for (const [skipRuleName, skipRuleFunction] of Object.entries(skipRules)) { - if (skipRedirect === false) { - skipRedirect = skipRuleFunction({ fromPath, toPath, redirect, localConfig, remoteConfig }) - log(`Rule: "${skipRuleName}"', 'skipRedirect?', ${skipRedirect}`) - } - } - - if (skipRedirect === false) { - newRedirects.push(redirectWithDateCommentText(new Date(), redirect)) - } else { - log('Not including redirect', redirect) - } - } - } else { - log('No path changes found') - } - - return newRedirects -} - -const main = async () => { - try { - const gitDiff = await fs.promises.readFile('./pr_diff', 'utf8') - - const remoteConfig = await getRemoteConfig() - const localConfig = await getLocalConfig() - const debug = process.env.DEBUG - const redirects = await getRedirects({ gitDiff, localConfig, remoteConfig, debug }) - - if (redirects.length > 0) { - log('Writing', redirects) - await appendToLocalConfig(redirects.join('')) - } - } catch (error) { - console.error(error) - } -} - -if (process.env.RUN_AS_SCRIPT === 'true') { - main() -} - -module.exports = { - getRedirects, -} diff --git a/scripts/safe_rename.test.js b/scripts/safe_rename.test.js deleted file mode 100644 index 04ce168e9..000000000 --- a/scripts/safe_rename.test.js +++ /dev/null @@ -1,151 +0,0 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ -const getRedirects = require('./safe_rename').getRedirects - -jest.useFakeTimers().setSystemTime(new Date('2021-08-09').getTime()) - -const debug = false - -const singleRenameGitDiff = ` -rename from contents/docs/one.md -rename to contents/docs/two.md` - -const multiRenameGitDiff = ` -rename from contents/docs/one.md -rename to contents/docs/two.md - -rename from contents/docs/cheese.md -rename to contents/docs/mushroom.md - -rename from contents/docs/fish.md -rename to contents/docs/monkey.md` - -const emptyConfig = `` -const existingRedirectConfig = ` -# Added: 2021-08-03 -[[redirects]] - from = "/docs/one" - to = "/docs/two"` - -test('redirect will be added for single file rename', async () => { - const gitDiff = singleRenameGitDiff - - const localConfig = emptyConfig - const remoteConfig = emptyConfig - - const redirects = await getRedirects({ gitDiff, localConfig, remoteConfig, debug }) - - expect(redirects.length).toBe(1) - expect(redirects[0]).toContain('# Added: 2021-08-09') - expect(redirects[0]).toContain('from = "/docs/one"') - expect(redirects[0]).toContain('to = "/docs/two"') -}) - -test('redirect will be added for multi file rename', async () => { - const gitDiff = multiRenameGitDiff - - const localConfig = emptyConfig - const remoteConfig = emptyConfig - - const redirects = await getRedirects({ gitDiff, localConfig, remoteConfig, debug }) - - expect(redirects.length).toBe(3) - - expect(redirects[0]).toContain('# Added: 2021-08-09') - expect(redirects[0]).toContain('from = "/docs/one"') - expect(redirects[0]).toContain('to = "/docs/two"') - - expect(redirects[1]).toContain('# Added: 2021-08-09') - expect(redirects[1]).toContain('from = "/docs/cheese"') - expect(redirects[1]).toContain('to = "/docs/mushroom"') - expect(redirects[2]).toContain('from = "/docs/fish"') - expect(redirects[2]).toContain('to = "/docs/monkey"') -}) - -test('redirect will only be added for non-existing redirects in multi file rename', async () => { - const gitDiff = multiRenameGitDiff - - const localConfig = emptyConfig - const remoteConfig = existingRedirectConfig - - const redirects = await getRedirects({ gitDiff, localConfig, remoteConfig, debug }) - - expect(redirects.length).toBe(2) - expect(redirects[0]).toContain('from = "/docs/cheese"') - expect(redirects[0]).toContain('to = "/docs/mushroom"') - expect(redirects[1]).toContain('from = "/docs/fish"') - expect(redirects[1]).toContain('to = "/docs/monkey"') -}) - -test('redirect will not be added if it already exists in the remote config', async () => { - const gitDiff = singleRenameGitDiff - - const localConfig = emptyConfig - const remoteConfig = existingRedirectConfig - - const redirects = await getRedirects({ gitDiff, localConfig, remoteConfig, debug }) - - expect(redirects.length).toBe(0) -}) - -test('redirect will not be added if it already exists in the local config', async () => { - const gitDiff = singleRenameGitDiff - - const localConfig = existingRedirectConfig - const remoteConfig = emptyConfig - - const redirects = await getRedirects({ gitDiff, localConfig, remoteConfig, debug }) - - expect(redirects.length).toBe(0) -}) - -test('redirect will not be added if rename from /name to /name/index.mdx', async () => { - const gitDiff = ` - rename from contents/docs/filename - rename to contents/docs/name/index.mdx` - - const localConfig = emptyConfig - const remoteConfig = emptyConfig - - const redirects = await getRedirects({ gitDiff, localConfig, remoteConfig, debug }) - - expect(redirects.length).toBe(0) -}) - -test('redirect will not be added if rename from /name to /name/index.md', async () => { - const gitDiff = ` - rename from contents/docs/name - rename to contents/docs/name/index.md` - - const localConfig = emptyConfig - const remoteConfig = emptyConfig - - const redirects = await getRedirects({ gitDiff, localConfig, remoteConfig, debug }) - - expect(redirects.length).toBe(0) -}) - -test('redirect will not be added if rename from .md to .mdx', async () => { - const gitDiff = ` - rename from contents/docs/filename.md - rename to contents/docs/filename.mdx` - - const localConfig = emptyConfig - const remoteConfig = emptyConfig - - const redirects = await getRedirects({ gitDiff, localConfig, remoteConfig, debug }) - - expect(redirects.length).toBe(0) -}) - -test('redirect will not be added when renaming snippets', async () => { - const gitDiff = ` - rename from contents/docs/snippets/js/capture.mdx - rename to contents/docs/snippets/js/special-capture.mdx` - - const localConfig = emptyConfig - const remoteConfig = emptyConfig - - const redirects = await getRedirects({ gitDiff, localConfig, remoteConfig, debug }) - - expect(redirects.length).toBe(0) -}) diff --git a/src/components/CommunityQuestions/AskAQuestion.js b/src/components/CommunityQuestions/AskAQuestion.js deleted file mode 100644 index 1f021c300..000000000 --- a/src/components/CommunityQuestions/AskAQuestion.js +++ /dev/null @@ -1,79 +0,0 @@ -import { useLocation } from '@reach/router' -import { Formik } from 'formik' -import React, { useState } from 'react' -import usePostHog from '../../hooks/usePostHog' -import AskQuestion from './AskQuestion' -import Avatar from './Avatar' -import QuestionSubmitted from './QuestionSubmitted' - -export default function AskAQuestion() { - const location = useLocation() - const posthog = usePostHog() - const [timestamp, setTimestamp] = useState(null) - const [emailSubmitted, setEmailSubmitted] = useState(false) - return ( -
-

Ask a question

-
- -
- { - const errors = {} - if (!values.name) { - errors.name = 'Required' - } - if (!values.subject) { - errors.subject = 'Required' - } - if (!values.question) { - errors.question = 'Required' - } - if (!values.email) { - errors.email = 'Required' - } - return errors - }} - onSubmit={(values, { setSubmitting, resetForm }) => { - if (values['mary-chain']) return - setSubmitting(true) - const body = JSON.stringify({ - ...values, - slug: location.pathname, - timestamp, - }) - fetch('/.netlify/functions/ask-a-question', { method: 'POST', body }) - .then((res) => res.json()) - .then((data) => { - posthog.capture('Question asked') - setTimestamp(data.timestamp) - setEmailSubmitted(true) - setSubmitting(false) - }) - }} - > - {({ isSubmitting, isValid, values, setFieldValue, submitForm }) => { - return !timestamp ? ( - - ) : ( - - ) - }} - -
-
-
- ) -} diff --git a/src/components/CommunityQuestions/AskQuestion.js b/src/components/CommunityQuestions/AskQuestion.js deleted file mode 100644 index f82ee4ffa..000000000 --- a/src/components/CommunityQuestions/AskQuestion.js +++ /dev/null @@ -1,80 +0,0 @@ -import { Field } from 'formik' -import React from 'react' -import Button from './Button' -import RichText from './RichText' - -export default function AskQuestion({ isValid, loading, setFieldValue, submitForm }) { - return ( - <> - - - - - -
- -

- Supports - - - - - - - - - - - - - - - - - - -

-
- - ) -} diff --git a/src/components/CommunityQuestions/EmailSubmitted.js b/src/components/CommunityQuestions/EmailSubmitted.js deleted file mode 100644 index ea588182a..000000000 --- a/src/components/CommunityQuestions/EmailSubmitted.js +++ /dev/null @@ -1,54 +0,0 @@ -import React, { useState } from 'react' -import { Check } from 'components/Icons/Icons' -import GitHubButton from 'react-github-btn' -import emailSaved from './email-saved.svg' -import Button from './Button' -import addToMailchimp from 'gatsby-plugin-mailchimp' - -export default function EmailSubmitted({ email }) { - const [subscribed, setSubscribed] = useState(false) - - const handleSubscribe = async () => { - await addToMailchimp(email) - setSubscribed(true) - } - return ( -
- {subscribed ? ( - <> -

- - - - You're subscribed! -

-
- Be sure to check us out on GitHub -
-

- - Star - -

- - ) : ( - <> -
-
We’ll email you.
-

We typically answer in 1-2 days.

- -
-

While we have you...

-
Care to receive our email updates?
- - - )} -
- ) -} diff --git a/src/components/CommunityQuestions/Question.js b/src/components/CommunityQuestions/Question.js deleted file mode 100644 index 2bd04afd1..000000000 --- a/src/components/CommunityQuestions/Question.js +++ /dev/null @@ -1,78 +0,0 @@ -import { MDXProvider } from '@mdx-js/react' -import { Blockquote } from 'components/BlockQuote' -import { MdxCodeBlock } from 'components/CodeBlock' -import { InlineCode } from 'components/InlineCode' -import Link from 'components/Link' -import { ZoomImage } from 'components/ZoomImage' -import { MDXRenderer } from 'gatsby-plugin-mdx' -import React from 'react' -import Avatar from './Avatar' - -export const Days = ({ ts, url }) => { - const days = Number(ts) - return ( - - {ts <= 0 ? 'Today' : `${ts} day${days === 1 ? '' : 's'} ago`} - - ) -} - -export const Reply = ({ avatar, name, childMdx, teamMember, ts, parentId, id, className = '' }) => { - const components = { - inlineCode: InlineCode, - blockquote: Blockquote, - pre: MdxCodeBlock, - img: ZoomImage, - } - return ( -
-
- -
-

- {teamMember?.frontmatter?.name || name} - , {teamMember?.frontmatter?.jobTitle || 'Contributor'} - -

-
- - {childMdx.body} - -
-
-
-
- ) -} - -export default function Question({ question, id }) { - const components = { - inlineCode: InlineCode, - blockquote: Blockquote, - pre: CodeBlock, - img: ZoomImage, - } - const { avatar, childMdx, name, ts, subject } = question[0] - return ( -
- -
- {subject &&

{subject}

} -
- - {childMdx.body} - -
-

- by {name}{' '} - -

- {question.length > 1 && - question.slice(1).map((reply, index) => )} -
-
- ) -} diff --git a/src/components/CommunityQuestions/QuestionSubmitted.js b/src/components/CommunityQuestions/QuestionSubmitted.js deleted file mode 100644 index 9df070709..000000000 --- a/src/components/CommunityQuestions/QuestionSubmitted.js +++ /dev/null @@ -1,27 +0,0 @@ -import { Check } from 'components/Icons/Icons' -import React from 'react' -import ReactMarkdown from 'react-markdown' -import EmailSubmitted from './EmailSubmitted' -import SubmitEmail from './SubmitEmail' - -export default function QuestionSubmitted({ values, emailSubmitted, isValid, loading }) { - return ( -
- {values.question} -

by {values.name}

-

- - - - Question sent. Answer will be posted here. -

-
- {emailSubmitted ? ( - - ) : ( - - )} -
-
- ) -} diff --git a/src/components/CommunityQuestions/RichText.js b/src/components/CommunityQuestions/RichText.js deleted file mode 100644 index cad0f7851..000000000 --- a/src/components/CommunityQuestions/RichText.js +++ /dev/null @@ -1,128 +0,0 @@ -import MDEditor from '@uiw/react-md-editor' -import React, { useEffect } from 'react' -import rehypeSanitize from 'rehype-sanitize' - -const bold = { - name: 'bold', - keyCommand: 'bold', - buttonProps: { 'aria-label': 'Bold', tabIndex: '-1' }, - icon: ( - - - - ), - execute: (state, api) => { - let modifyText = `**${state.selectedText}**` - if (!state.selectedText) { - modifyText = `****` - } - api.replaceSelection(modifyText) - }, -} - -const italic = { - name: 'italic', - keyCommand: 'italic', - buttonProps: { 'aria-label': 'Italicize', tabIndex: '-1' }, - icon: ( - - - - ), - execute: (state, api) => { - let modifyText = `*${state.selectedText}*` - if (!state.selectedText) { - modifyText = `**` - } - api.replaceSelection(modifyText) - }, -} - -const code = { - name: 'code', - keyCommand: 'code', - buttonProps: { 'aria-label': 'Code', tabIndex: '-1' }, - icon: ( - - - - - ), - execute: (state, api) => { - let modifyText = `\`\`\`\n${state.selectedText}\n\`\`\`` - if (!state.selectedText) { - modifyText = `\`\`\`\`\`\`` - } - api.replaceSelection(modifyText) - }, -} - -const link = { - name: 'link', - keyCommand: 'link', - buttonProps: { 'aria-label': 'Link', tabIndex: '-1' }, - icon: ( - - - - - - - - - - - - ), - execute: (state, api) => { - let modifyText = `[${state.selectedText}]()` - if (!state.selectedText) { - modifyText = `[]()` - } - api.replaceSelection(modifyText) - }, -} - -export default function RichText({ setFieldValue }) { - const [value, setValue] = React.useState('') - - useEffect(() => { - setFieldValue('question', value) - }, [value]) - return ( -
- - cmd && /(fullscreen|divider|preview|live|edit)/.test(cmd.name || cmd.keyCommand) ? false : cmd - } - preview={'edit'} - value={value} - onChange={setValue} - previewOptions={{ - rehypePlugins: [[rehypeSanitize]], - }} - /> -
- ) -} diff --git a/src/components/CommunityQuestions/SubmitEmail.js b/src/components/CommunityQuestions/SubmitEmail.js deleted file mode 100644 index bb4899fcd..000000000 --- a/src/components/CommunityQuestions/SubmitEmail.js +++ /dev/null @@ -1,27 +0,0 @@ -import React from 'react' -import { Form, Field } from 'formik' -import Button from './Button' - -export default function SubmitEmail({ isValid, loading }) { - return ( - <> -

Get your answer by email

-

No need to constantly refresh this page for updates!

-
- - - -

- We’ll only email you when an answer is posted. We don’t share emails, and if you use Gravatar, we’ll - include your photo next to your question. -

- - ) -} diff --git a/src/components/CommunityQuestions/Subscribed.js b/src/components/CommunityQuestions/Subscribed.js deleted file mode 100644 index 59d7c20ab..000000000 --- a/src/components/CommunityQuestions/Subscribed.js +++ /dev/null @@ -1,30 +0,0 @@ -import React from 'react' -import { Check } from 'components/Icons/Icons' -import GitHubButton from 'react-github-btn' - -export default function Subscribed() { - return ( - <> -

- - - - You're subscribed! -

-
- Be sure to check us out on Github.com -
-

- - Star - -

- - ) -} diff --git a/src/components/CommunityQuestions/avatar.png b/src/components/CommunityQuestions/avatar.png deleted file mode 100644 index b5c0e6a7a9c348b9ec0c9d1bb5b9f3e9d489d984..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2554 zcmVzo7-1bK|22x_tdaRnDwaG4d1u3%jw0a{i^YXZhBkDTa>k{c*6M*F$|*$) zgp1)zJBlj&ScRWc!d>H--<774aj0;1MumJnUm?LL5(W#9o0y_aQu?7Hv%wGLC|*h| zSiy148%@StR4(x`X%zf#P^W+7K6RzyQ7_44kW2R~Cx z#3Be>lxx&){BBa_6KPYblX)D63maJwh+#;*HR;c=r4frLBMGwivAC{W_4W#lqDBKr zP1iggB|kQ_AY(BC7*Uj=1R0AlfDuHAEQlAtd00CZV*o5lU71HwV@jlXh#$bmVuXNC zo=x(xD)KRl^0G*Rj7L+E$?*j8H_Xw(z96(9`|o#t8H+IlJU7FHIqcIz34#>CzikE{ zCpdOt(<}pn`Z$QkM93gN&_a;49g7hI9OS2PECS9X#xFM0m$p*Hr*rJ|&v?%ymxx%|PijA4KS?zX^^ z0G;J?9YXl{;eaZK@vNWNF)wz`Zv!7(OUh7ECVriap0=)A2^7zD^!%$LZ#+y{L@;qkt55L_dg^ehL6i* z`u)B4=Ys%2TqV5aWLHVK%@)f*@&u z(c58+F)9|6euyhikc?Ij$s!-hA1Q6{13=7@LTkk_PschLl%IW z$O@?fnV6JQjiQxm_P4dc?CdPr2JQ+Kj}qYIVgb>tM3z8xp=~6Uouc8hc8xtjP={;V zZAm&~XcSwBGeg^Ck@@)>WD8h_q-w^qDhrZd%vU(PTM6s{1<|&wWcl_@5=04A@XazH zW6w%3+FD+|MQL+`EmKM`2d-;=$8~dx%D#&%g5Z9AHoX9kk(IQHcs7dHxNg>EspcJ< z+*!Gun(Ml~vMjC=9y>L(u8CH#8q{JO0dQUS?yn{;$}Nr?GxAngmHf4a=UFvF_N@f2 zzg0~+!jF6F>Xsis{iiVicm4IV8?ys-@dSSN;!+W&XQ`2s-(d)o< zg4lrc3Wmi~eCbuS0wGUNPx<|-UJH((+Aj$W1%lc$1$NR%BbI~_A_xf5UM(_=JMt|M z;-pJ&>+t>(^pYe;To^H7U7?if_mqX{yRAjvUNhdNUP}E!F##8H@ac1`T^iy9Zt-@) zlSrO-Jngrs*udsLaRhh>arn97T_n}?29Z?YH^%&b?QVXf-*X0jq9XIu4B1HevI*hy zg-3h1#43!UN`nUXlL^%xYZ%wnIfT8;G~>&Sk%VFE_?fNa<)G( zW8XIKs#;1^G1it-+&0grpD5_uCbq|6M3Brx@kP>NG~Z%G`fY0wXJ=7cEG#Y1O&(Q+ zSQBY~>s6nAqF{pfiG{gLGj#v~zPq&)u2RKNp{~sLA~q*(Cus5r7xwAnfvC6NZC+P>itx&nHNkH}xvLOxiUCA!0+F-Ewh5x%31(G^8$$ zF*|H*uPH;X{XINvB0`XMkRKz5)|H`6o@73ZT_6^~TjZ*!z_H=AYudUL}GnNWMpPx# diff --git a/src/components/CommunityQuestions/email-saved.svg b/src/components/CommunityQuestions/email-saved.svg deleted file mode 100644 index 5d688108c..000000000 --- a/src/components/CommunityQuestions/email-saved.svg +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -