PingCAP Docsite Preview Help

Deploy your website locally

This document describes how to deploy your documentation website using your local machine.

Prerequisites

Make sure that you have installed the following tools:

    Steps

    Perform the following steps to deploy a live preview of your documentation website locally.

    1. Clone the fork pingcap-docsite-preview to your local machine and switch to the branch you want to preview.

      git clone https://github.com/Oreoxmt/pingcap-docsite-preview.git cd pingcap-docsite-preview git checkout preview/pingcap/docs/1234
    2. Run the following command to preview the current branch locally.

      ./build.sh dev
    3. Optional: Preview images.

      During the build process, the website-docs/public directory is generated. To preview images in development mode, copy the image folders to website-docs/public/media/{lang}/{product}/. For example:

      mkdir -p website-docs/public/media/en/tidb cp -r markdown-pages/en/tidb/master/media/. website-docs/public/media/en/tidb/ mkdir -p website-docs/public/media/zh/tidb cp -r markdown-pages/zh/tidb/master/media/. website-docs/public/media/zh/tidb/ mkdir -p website-docs/public/media/en/tidb-in-kubernetes cp -r markdown-pages/en/tidb-in-kubernetes/master/media/. website-docs/public/media/en/tidb-in-kubernetes/ mkdir -p website-docs/public/media/zh/tidb-in-kubernetes cp -r markdown-pages/zh/tidb-in-kubernetes/master/media/. website-docs/public/media/zh/tidb-in-kubernetes/ mkdir -p website-docs/public/media/en/tidb-cloud cp -r markdown-pages/en/tidb-cloud/master/media/. website-docs/public/media/en/tidb-cloud/
    4. Open the preview URL in your browser. For example, http://localhost:8000.

      Note that if port 8000 is not available, you need to type y in your terminal to use another port:

      Something is already running at port 8000 ✔ Would you like to run the app at another port instead? … yes ... You can now view website-docs in the browser. http://localhost:8001/
    27 March 2026