Skip to content

PostHog/posthog.com

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ec3db8f · Jun 2, 2024
Apr 8, 2024
Mar 23, 2022
Apr 25, 2023
Jun 2, 2024
May 28, 2024
Apr 8, 2024
Feb 13, 2024
May 31, 2024
May 31, 2024
Mar 27, 2024
Apr 18, 2024
Apr 22, 2024
Aug 27, 2021
Apr 1, 2021
May 21, 2024
Jul 16, 2021
Jul 21, 2022
Sep 17, 2020
Jul 21, 2022
Mar 6, 2023
Apr 23, 2024
Feb 14, 2024
Mar 5, 2024
May 14, 2024
Mar 19, 2024
May 21, 2024
Aug 11, 2021
May 30, 2024
Oct 5, 2021
May 31, 2024
May 31, 2024
Mar 13, 2023
May 28, 2024
May 31, 2024

Repository files navigation

posthoglogo

PostHog.com - Website, docs, blog, and handbook

PRs Welcome GitHub contributors Join Community GitHub commit activity GitHub closed pull requests

Support - Roadmap - Open an issue - Style guide

This is the repository for the PostHog website. It contains:

  • All of our written content and visuals including product features, manuals, docs, blogs, case studies, tutorials, and the handbook
  • Features like questions and answers (using Squeak!), job listings (using Ashby), pricing calculator, roadmap, API docs, and more
  • All the components, templates, logic, and styling to make this work, look pretty, and spark joy

Table of contents

Quick start

  1. Pre-installation

    Install Node and Yarn. (If you're on a Mac with Apple Silicon and get an error with -86 in it, you may need to install Rosetta.)

    npm install --global yarn
  2. Start developing

    Clone the repo then navigate into your new site’s directory, install the site dependencies, and start it up.

    cd posthog.com/
    yarn
    yarn start

    Tip: Seeing a discrepancy between local development and staging/production? Preview the production build locally by running gatsby build && gatsby serve

  3. Open the source code and start editing!

    Your site is now running at http://localhost:8001!

    Note: You'll also see a second link: http://localhost:8001/___graphql. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the Gatsby tutorial.

See full instructions on developing PostHog.com locally in our manual.

Advanced setup

Docker

It is also possible to use Docker to run posthog.com locally with this command:

docker run -it --rm \
    -w /app -v "$PWD":/app \
    -p 8000-8001:8000-8001 \
    -e INTERNAL_STATUS_PORT=8001 \
    node:14-slim \
    sh -c 'yarn && yarn start'

Debugging errors on start

  1. Pull the latest changes from master
  2. Run gatsby clean && yarn start or delete node_modules and .cache
  3. Check builds are passing in deployment to Vercel

Working on /docs/api?

The site will load the API schema from US Cloud by default. You can override this to use your local PostHog instance with an env var:

POSTHOG_OPEN_API_SPEC_URL="http://127.0.0.1:8000/api/schema/" yarn start

Want Ashby job listings or GitHub contributors to load?

You’ll need to set environment variables for these. See (private) instructions for this.

Developing the posts section

To see your local version of the posts section, /posts needs to be visited directly (http://localhost:8001/posts)

Developing the merch store

Additional environment variables are needed to develop the merch store:

  • SHOPIFY_APP_PASSWORD
  • GATSBY_MYSHOPIFY_URL
  • GATSBY_SHOPIFY_STOREFRONT_TOKEN

Currently, these environment variables are excluded from Vercel preview builds to disable merch store node creation and speed up build times on non-merch related PRs.

Contributing

We <3 contributions big and small. In priority order (although everything is appreciated) with the most helpful first: